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

Fix: ajout vérification sur la fonction loadXMLDoc

parent f4694385
No related branches found
No related tags found
No related merge requests found
......@@ -145,7 +145,7 @@ function loadMonth(base,month,year,ymd)
theURL+="&sd="+ymd;
}
loadXMLDoc(theURL,null,false);
loadXMLDoc(theURL,alertContents,false);
showDP.box.innerHTML=req.responseText;
}
......@@ -259,6 +259,13 @@ function loadXMLDoc(url,readyStateFunction,async)
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
if (req.overrideMimeType) {
req.overrideMimeType('text/xml');
}
if (!req) {
alert('Cannot create XMLHTTP instance');
return false;
}
req.onreadystatechange = readyStateFunction;
req.open("GET", url, async);
req.send(null);
......@@ -273,6 +280,17 @@ function loadXMLDoc(url,readyStateFunction,async)
}
}
function alertContents(httpRequest)
{
if (httpRequest.readyState == 4) {
if (httpRequest.status == 200) {
alert(httpRequest.responseText);
} else {
alert('There was a problem with the request.');
}
}
}
function hideSelectBoxes() {
var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10);
if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE") > -1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment