Salve a tutti...
https://www.mrw.it/ajax/articoli/chat-asp-ed-ajax_708.html
Nella guida del link sopra, cè questo script che funziona alla perfezione :beer:...tranne che chiaramente su IE...:quote:...a parte l'ironia, qualcuno mi da una mano per farlo andare ache su internet explorer.
// JavaScript Document
function Aggiorna()
{
return Richiesta();
}
window.setInterval("Aggiorna()", 3000)
var XMLHTTP;
function Richiesta()
{
XMLHTTP = RicavaBrowser(CambioStato);
XMLHTTP.open("GET", "ajax.asp", true);
XMLHTTP.send(null);
}
function CambioStato()
{
if (XMLHTTP.readyState == 4)
{
var R = document.getElementById("CHAT");
R.innerHTML = XMLHTTP.responseText;
}
}
function RicavaBrowser(QualeBrowser)
{
if (navigator.userAgent.indexOf("MSIE") != (-1))
{
var Classe = "Msxml2.XMLHTTP";
if (navigator.appVersion.indexOf("MSIE 5.5") != (-1));
{
Classe = "Microsoft.XMLHTTP";
}
try
{
OggettoXMLHTTP = new ActiveXObject(Classe);
OggettoXMLHTTP.onreadystatechange = QualeBrowser;
return OggettoXMLHTTP;
}
catch(e)
{
alert("Errore: l'ActiveX non verrà eseguito!");
}
}
else if (navigator.userAgent.indexOf("Mozilla") != (-1))
{
OggettoXMLHTTP = new XMLHttpRequest();
OggettoXMLHTTP.onload = QualeBrowser;
OggettoXMLHTTP.onerror = QualeBrowser;
return OggettoXMLHTTP;
}
else
{
alert("L'esempio non funziona con altri browser!");
}
}
grazie
https://www.mrw.it/ajax/articoli/chat-asp-ed-ajax_708.html
Nella guida del link sopra, cè questo script che funziona alla perfezione :beer:...tranne che chiaramente su IE...:quote:...a parte l'ironia, qualcuno mi da una mano per farlo andare ache su internet explorer.
// JavaScript Document
function Aggiorna()
{
return Richiesta();
}
window.setInterval("Aggiorna()", 3000)
var XMLHTTP;
function Richiesta()
{
XMLHTTP = RicavaBrowser(CambioStato);
XMLHTTP.open("GET", "ajax.asp", true);
XMLHTTP.send(null);
}
function CambioStato()
{
if (XMLHTTP.readyState == 4)
{
var R = document.getElementById("CHAT");
R.innerHTML = XMLHTTP.responseText;
}
}
function RicavaBrowser(QualeBrowser)
{
if (navigator.userAgent.indexOf("MSIE") != (-1))
{
var Classe = "Msxml2.XMLHTTP";
if (navigator.appVersion.indexOf("MSIE 5.5") != (-1));
{
Classe = "Microsoft.XMLHTTP";
}
try
{
OggettoXMLHTTP = new ActiveXObject(Classe);
OggettoXMLHTTP.onreadystatechange = QualeBrowser;
return OggettoXMLHTTP;
}
catch(e)
{
alert("Errore: l'ActiveX non verrà eseguito!");
}
}
else if (navigator.userAgent.indexOf("Mozilla") != (-1))
{
OggettoXMLHTTP = new XMLHttpRequest();
OggettoXMLHTTP.onload = QualeBrowser;
OggettoXMLHTTP.onerror = QualeBrowser;
return OggettoXMLHTTP;
}
else
{
alert("L'esempio non funziona con altri browser!");
}
}
grazie