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); } } Link to comment https://forums.phpfreaks.com/topic/53314-runtime-error-loading-file/ 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 } } Link to comment https://forums.phpfreaks.com/topic/53314-runtime-error-loading-file/#findComment-267987 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. Link to comment https://forums.phpfreaks.com/topic/53314-runtime-error-loading-file/#findComment-268038 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.