Parsing URL Parameters on runtime

  • Hi all,

    I am putting my hands on my very first plugin, btw. I am quite new to JavaScript in total (my world was PHP before).

    I was quite sure, that everything is set up quite well, but on runtime, all I get is a black screen (I am still on the last real stable version).

    This is the action script I set up:

         //////////////////////////////////////
         // Actions
         pluginProto.acts = {};
         var acts = pluginProto.acts;
    
         acts.ParamGet = function (myparam)
         {
              var query = window.location.search.substring(1);
              var vars = query.split("&");
              for (var i=0;i<vars.length;i++) {
                var pair = vars[i].split("=");
                if (pair[0] == variable) {
                  this.ParamValue = pair[1];
                }
              } 
         };
    

    For instance Class I set up this:

         /////////////////////////////////////
         // Instance class
         pluginProto.Instance = function(type)
         {
              this.type = type;
              this.runtime = type.runtime;
              this.ParamValue = "";
         };
    

    I am also not yet familiar with the error console in Chrome and Firefox (never needed for PHP), I do hope someone can figure out what is my fault?

    Here is a live example:

    ubivis.de/test

    This should show up a textfield with the value of parameter "test"

  • Please forget my previous question... found my mistake now (after spending hours without having a clue).

    It is still not working, but at least I did a big step forward ;)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • All problems solved... will be released soon :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)