If you want to change the current location to a specific URL using the “Do a” GET command on the URL, all you need to do is assign a new URL to the variable location:
var newUrl = "http://test";
window.location = newUrl;
If you want to build a url by adding some query parameters, you can do:
newUrl += "?myid=" + myid;
Alternatively, you can use the function to map parameters to URLs:
function generateUrl(url, params) {
var i = 0, key;
for (key in params) {
if (i === 0) {
url += "?";
} else {
url += "&";
}
url += key;
url += '=';
url += params[key];
i++;
}
return url;
}
:
window.location = generateUrl("http://test",{
myid: 1,
otherParameter: "other param value"
});
obs: int/bool/string params. .