Difference between revisions of "Passing parameters to Web Apps"

From Lianjapedia
Jump to: navigation, search
(Created page with "In the ready delegate of your Web App you can access the arguments specified on the URL.: <code lang="javascript"> If (typeof LianjaAppBuilder !== "undefined") return; // ig...")
 
Line 15: Line 15:
 
}
 
}
 
</code>
 
</code>
 +
 +
[[category:Tips And Tricks]

Revision as of 15:39, 26 December 2017

In the ready delegate of your Web App you can access the arguments specified on the URL.:

If (typeof LianjaAppBuilder !== "undefined") return;  // ignore in development mode
var query_string = "";
var href = window.location.href;
var pos = href.indexOf("?");
if (pos > 0) query_string = href.substring(pos+1);
var argv = query_string.split("&");
for (var i=0; i<argv.length; ++i)
{
    arg = argv[i].split("=");
    argname = arg[0];
    argvalue = arg[1];
}

[[category:Tips And Tricks]