hayson1991
01-13-2008, 02:00 AM
This is for firefox only:
<script>
var Ajax={};
Ajax.conn=[];
Ajax.new=function(url,num)
{
if (!num)
{
num=Ajax.conn.length;
}
Ajax.conn[num]=new XMLHttpRequest();
Ajax.conn[num].onreadystatechange=function()
{
if (Ajax.conn[num].readyState==4)
{
if (Ajax.conn[num].status==200)
{
if (Ajax.conn[num].responseText)
{
alert(Ajax.conn[num].responseText);
}
else
{
Ajax.new(url,num);
}
}
}
}
Ajax.conn[num].open("get",url);
Ajax.conn[num].send(null);
}
Ajax.new("test.php");
</script>
The error exists on the line "if (Ajax.conn[num].status==200)", Error Console says: "Error: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"
Can someone help me find an alternative or find why this is?
<script>
var Ajax={};
Ajax.conn=[];
Ajax.new=function(url,num)
{
if (!num)
{
num=Ajax.conn.length;
}
Ajax.conn[num]=new XMLHttpRequest();
Ajax.conn[num].onreadystatechange=function()
{
if (Ajax.conn[num].readyState==4)
{
if (Ajax.conn[num].status==200)
{
if (Ajax.conn[num].responseText)
{
alert(Ajax.conn[num].responseText);
}
else
{
Ajax.new(url,num);
}
}
}
}
Ajax.conn[num].open("get",url);
Ajax.conn[num].send(null);
}
Ajax.new("test.php");
</script>
The error exists on the line "if (Ajax.conn[num].status==200)", Error Console says: "Error: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"
Can someone help me find an alternative or find why this is?