ciao a tutti ho un div che si aggiorna ogni tot secondi
codice:
function Update2()
{
return Request2();
}
window.setInterval("Update2()", 3000)
var XMLHTTP2;
function Request2()
{
var noCache2= Math.floor(Math.random() * (9999))
XMLHTTP2 = GetBrowser2(ChangeStatus2);
XMLHTTP2.open("GET", "prova.php?nocache="+noCache2, true);
XMLHTTP2.send(null);
}
function ChangeStatus2()
{
if (XMLHTTP2.readyState == 4)
{
var R2 = document.getElementById("prova");
R2.innerHTML = XMLHTTP2.responseText;
}
}
function GetBrowser2(FindBrowser2)
{
if (navigator.userAgent.indexOf("MSIE") != (-1))
{
var Class2 = "Msxml2.XMLHTTP";
if (navigator.appVersion.indexOf("MSIE 5.5") != (-1));
{
Class2 = "Microsoft.XMLHTTP";
}
try
{
ObjXMLHTTP2 = new ActiveXObject(Class2);
ObjXMLHTTP2.onreadystatechange = FindBrowser2;
return ObjXMLHTTP2;
}
catch(e)
{
alert("attenzione: l'ActiveX non sarà eseguito!");
}
}
else if (navigator.userAgent.indexOf("Mozilla") != (-1))
{
ObjXMLHTTP2 = new XMLHttpRequest();
ObjXMLHTTP2.onload = FindBrowser2;
ObjXMLHTTP2.onerror = FindBrowser2;
return ObjXMLHTTP2;
}
else
{
alert("L'esempio non funziona con altri browser!");
}
}
solo che nel div devo recuperare delle variabili che stanno nella pagina principale, appena accedo , le variabili sono valorizzare,mentre appena il div si aggiorna, le variabili sono vuote....perchè?