well this code is working in IE but not in Firefox... function getFile(pURL) { if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=postFileReady; xmlhttp.open("GET", pURL, true); xmlhttp.send(null); } else if (window.ActiveXObject) { //IE xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); if (xmlhttp) { xmlhttp.onreadystatechange=postFileReady; xmlhttp.open('GET', pURL, true); xmlhttp.send(); } } } // function to handle asynchronous call function postFileReady() { if (xmlhttp.readyState==4) { if (xmlhttp.status==200) { document.getElementById('theExample').innerHTML=xmlhttp.responseText; } } } getFile('http://example.com/example.html'); Code (markup): any idea how to solve it??