Hello all!
I have a small problem on IE browser (actually on Google Chrome too)
I have this js code
function createDoc(url) {
var xhttp = ajaxRequest();
var currentLocationBase = window.location.href;
currentLocationBase = currentLocationBase.substr(0,currentLocationBase.lastIndexOf("/") + 1);
var u = currentLocationBase + url;
xhttp.open("GET", u, false);
xhttp.send(null);
var xml = xhttp.responseXML;
return xml;
}
/**
* Builds an AJAX reques handler.
*
* @return The handler.
*/
function ajaxRequest() {
var xhttp = null;
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else if (window.ActiveXObject){
// Internet Explorer 5/6
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
}
return xhttp;
}
In Firefox this code works great, but not in IE and Google Chrome
Seems that the error is given at the line
xhttp.open("GET", u, false);
Can anyone help me to understand what i'm doing wrong?
Thanks