My question is: can I change worklight server url dynamically (with javascript) ? tnks for the answers.
Thank you for the answers! this is my code:
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send();
return xhttp.responseXML;
}
function wlCommonInit(){
xmlDoc=loadXMLDoc("/BadgeSYSmProj/apps/BadgeSysApp/application-descriptor.xml");
x=xmlDoc.getElementsByTagName("worklightServerRootURL")[0].childNodes[0];
x.nodeValue="http:\\NEW URL.html";
document.write(x.nodeValue);
...
...
but there is an fault:
Failed to load resource: the server responded with a status of 404 (ProxyServlet: /BadgeSYSmProj/apps/BadgeSysApp/application-descriptor.xml) http**://localhost:8080/apps/services/preview/BadgeSysApp/common/0/default/js/BadgeSysApp.js Uncaught TypeError: Cannot call method 'getElementsByTagName' of null