В мозиле скрипт не работает.
Добавлено: 03 фев 2007, 22:26
не работает как я выяснил из-за XMLHttpRequest. Как же быть?
C уважением БоБ.
------------------------------------------------------------
<script lanaguage = JavaScript>
function loadXMLDoc(t,url)
{
var Q=new Object;
Q=(window.XMLHttpRequest?new XMLHttpRequest():
(window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new Object));
Q.onreadystatechange=function()
{
// only if req. shows "complete"
if (Q.readyState==4)
{
//alert(Q.status+' '+Q.statusText); // only if "OK"
if (Q.status==200||location.href.indexOf('http:')<0&&Q.status==0)
{
t.innerHTML+=Q.responseText;
//t.innerHTML+=Q.responseXML.documentElement.nodeName;
//for(i in Q.responseXML){alert(i+'='+eval('Q.responseXML.'+i));}
}
}
};
Q.open("get", url, true);
Q.send(null);
}
//alert(location.href.indexOf('http:'))
//alert(navigator.onLine)
//.responseXML.firstChild;
</script>
</head>
<body onload = " loadXMLDoc( a1,'http://www.bob020202.narod.ru//fruits.xml'); " >
<font id ="a1" > </font>
</body>
C уважением БоБ.
------------------------------------------------------------
<script lanaguage = JavaScript>
function loadXMLDoc(t,url)
{
var Q=new Object;
Q=(window.XMLHttpRequest?new XMLHttpRequest():
(window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new Object));
Q.onreadystatechange=function()
{
// only if req. shows "complete"
if (Q.readyState==4)
{
//alert(Q.status+' '+Q.statusText); // only if "OK"
if (Q.status==200||location.href.indexOf('http:')<0&&Q.status==0)
{
t.innerHTML+=Q.responseText;
//t.innerHTML+=Q.responseXML.documentElement.nodeName;
//for(i in Q.responseXML){alert(i+'='+eval('Q.responseXML.'+i));}
}
}
};
Q.open("get", url, true);
Q.send(null);
}
//alert(location.href.indexOf('http:'))
//alert(navigator.onLine)
//.responseXML.firstChild;
</script>
</head>
<body onload = " loadXMLDoc( a1,'http://www.bob020202.narod.ru//fruits.xml'); " >
<font id ="a1" > </font>
</body>