Skip to content
Snippets Groups Projects
Commit ae0b3bb0 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: ajout vérification sur la fonction loadXMLDoc

parent 7919085d
No related branches found
No related tags found
No related merge requests found
......@@ -262,8 +262,14 @@ function loadXMLDoc(url,readyStateFunction,async)
if (req.overrideMimeType) {
req.overrideMimeType('text/xml');
}
if (req) {
if(readyStateFunction) req.onreadystatechange = readyStateFunction;
req.open("GET", url, async);
req.send(null);
} else {
alert('Cannot create XMLHTTP instance');
return false;
}
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
......@@ -271,8 +277,7 @@ function loadXMLDoc(url,readyStateFunction,async)
if(readyStateFunction) req.onreadystatechange = readyStateFunction;
req.open("GET", url, async);
req.send();
}
else {
} else {
alert('Cannot create XMLHTTP instance');
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment