This is my Ajax.js, this code only work with IE8 or less but in Mozilla Firefox 3.6 doesn't work correctly. function getXMLHTTPRequest() { var req; try { req = new XMLHttpRequest(); } catch(err1) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (err2) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (err3) { req = false; } } } return req; } HTML: What is the mistake ?
try adding this to your code: if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari req =new XMLHttpRequest(); } else {// code for IE6, IE5 req =new ActiveXObject("Microsoft.XMLHTTP"); }