I decided to enter the world of AJAX today for a site I am working on. It is nothing overly complex, however it is a start. I have the script working beautifully on FireFox. No errors or anything, however when I bring it over to Internet Explorer I get a rather unhelpfull error message. (Object Required, line 66) - the page is available at http://china.fingerprint.com.au/test_ajax.html to see it in full context, the main problem is that the DOM Inspector I have installed shows line 66 as something completely different to what my text editor (vi) shows line 66 as and I cannot for the life of my figure out what the problem is.

My instincts tell me it is the XML handling in my gotCont function (first snippet) however the DOM inspector shows line 66 as being the line adding the &date= ... to the end of the URL (which is fine afaik).

I am not a javacript programmer - I know enough to do basics, I am more backend, so any help would be very much appreciated.



function gotCont(http_request){
        divLoader = document.getElementById('Load');
        divData = document.getElementById('Content');
        divMenu = document.getElementById('Men');
        if(http_request.readyState == 4){
                if(http_request.status == 200){
                        divLoader.innerHTML = "";
                        var xmldoc = http_request.responseXML;
                        var xmlHtml = xmldoc.getElementsByTagName("html").item(0);
                        var xmlMenu = xmldoc.getElementsByTagName("menu").item(0);
                        divData.innerHTML = xmlHtml.childNodes[0].data;
                        divMenu.innerHTML = xmlMenu.childNodes[0].data;
                        alert("There was a problem with the request");
                //Menu.innerHTML = "";
                divData.innerHTML = "";
                divLoader.innerHTML = "<table width='50' height='20' bgcolor='#eeeeee' style='border-style: solid; border-width:1px;'><tr><td style='border-style: none;'><img src='loading.gif'></td><td style='border-style: none;'>Loading...</td></tr></table>";
function reqCont(url){
	var http_request=false;
		http_request = new XMLHttpRequest();
	}else if(window.ActiveXObject){
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
				http_request = new ActiveXObject("Microsoft.XMLHTTP");

		alert("Cannot create XMLHTTP Instance");
		return false;
	var date = new Date();
	var surl = url + "&time=" + date.getTime();
	http_request.onreadystatechange = function(){ gotCont(http_request)};