lilman Posted May 28, 2007 Share Posted May 28, 2007 I am getting a runtime error on I.E. but not on FireFox. Below is the code: function ajaxLoader(url,id) { if (document.getElementById) { var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); } if (x) { x.onreadystatechange = function() { if (x.readyState == 4 && x.status == 200) { el = document.getElementById(id); el.innerHTML = x.responseText; // This is the line it says the error is happening on } } x.open("GET", url, true); x.send(null); } } Quote Link to comment Share on other sites More sharing options...
mainewoods Posted June 5, 2007 Share Posted June 5, 2007 put this x.open("GET", url, true); before this x.onreadystatechange = function() { if (x.readyState == 4 && x.status == 200) { el = document.getElementById(id); el.innerHTML = x.responseText; // This is the line it says the error is happening on } } Quote Link to comment Share on other sites More sharing options...
mainewoods Posted June 5, 2007 Share Posted June 5, 2007 el.innerHTML = x.responseText; // This is the line it says the what is the resonseText? ie can be finicky about what you try to innerHTML into something. it can have problems with forms, complex html, and js. Or are you trying to inject a block level item into an inline item, like innerHTML a div or a ul into a span? You can't do that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.