Passing parameters to Web Apps

From Lianjapedia
Revision as of 15:41, 26 December 2017 by Barrymavin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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];
}