Building the URL in Javascript

When necessary, modern browsers encode URLs automatically, but it is convenient to do it by code. The Javascript lines below show how to build the URL used in the previous example:

var buildURL = function(server, virtualpath, arguments) {

return server + "/" + virtualpath + "/" + encodeURIComponent(arguments.join(' '));

}

var baseURL = "http://192.168.0.229:6580/";

var applicationPath = "TestArguments";

var arguments = ["one", "two", "three"];

var url = buildURL(baseURL, applicationPath, arguments);

Read more:

· Setting Command Line Arguments in the Application Profile

· Sending Command Line Arguments in the VirtualUI URL

· Combining Application Profile and URL Command Line Arguments

Last updated