Could anyone explain me why:
function doAjax() {
var xmlHttpReq = false;
try { // Firefox, Opera 8.0+ and Safari
xmlHttpReq = new XMLHttpRequest();
}
catch (e) { // Internet Explorer
try {
xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Your browser does not support AJAX. Please use an AJAX compatible browser.");
return false;
}
}
}
xmlHttpReq.open('GET', 'handler.php', true);
xmlHttpReq.onreadystatechange = function() {
if (xmlHttpReq.readyState == 4) {
var response = xmlHttpReq.responseText;
handleAjaxResponse(response);
}
};
xmlHttpReq.send(null);
return true;
}
is causing the following validation errors:
Error:
Implied global: ActiveXObject 8, XMLHttpRequest 4, alert 15, handleAjaxResponse 24
Problem at line 10 character 16: 'e' is already defined.
catch (e) {
Problem at line 14 character 20: 'e' is already defined.
catch (e) {
by the JSlint.com javascript validator