Hi, Got a quick question on Ajax and I.E7.
Basically Im trying to create a ajax driven site that allows people to register for a regular event. I’ve got most of it done and it all works well and good in firefox and netscape navigator. But when it comes to I.E well the sh*t just hits the fan as they say.
The problem is with the javascript function that displays the already registered racers. It has to use the XMLHttpRequest Object to get the data (a text file) so that it can use various string methods to split and eventually display the data contained within. (Its set in a function that runs various other functions in a specific order once the page has loaded.
function GetXmLHttpObject()
{
var xmlHttp = null;
try
{
xmlHttp = new XMLHttpRequest();
}
catch(e)
{
try
{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
//Function to display registered racers.//
function RDset()
{
var rddata = GetXmlHttpObject();
var rdurl = "cgibin/Data/RD/RDdate.txt";
***[COLOR=Black]rddata.open("GET", rdurl, true);[/COLOR]***
//rddata.overrideMimeType("text/xml");//
rddata.onreadystatechange = function()
{
if(rddata.readyState == 4)
{
var RaceDate = rddata.responseText;
//alert(RaceDate);
RDSarray = RaceDate.split(" ", 3);
//alert(RDSarray[2]+"testing");
FnYear = RDSarray[2]*1;
FnMonth = RDSarray[1]*1;
FnDay = RDSarray[0]*1;
rddata = null;
}
}
rddata.send(null);
}
The problem in I.E is that I recieve a runtime error as the RDset() makes the XMLHttpRequest call.
Microsoft Script Debugger (I cant get ahold of office for MSE) then pops up with ‘rddata.open(“GET”, rdurl, true);’ highlighted as the problem. I’ve searched the net and various other forums and tried several different solutions but cant seem to get them to work.
Anyhelp or insight into what i’m or is going wrong would be greatly appreciated.
Thanks in advance.
Legion. :pir: