il codice AJAX è questo:
-------------------------------
var XMLHTTP;
function RichiestaAJAXusername(stringa)
{
if (stringa.length > 0)
{
var url = "/base/negozio/pagine/controlla_username.asp?testo=" + stringa.toUpperCase();
XMLHTTP = QualeBrowser(GestioneStato);
XMLHTTP.open("GET", url, true);
XMLHTTP.send(null);
}
else
{
document.getElementById("nomi").innerHTML = "";
}
}
function GestioneStato()
{
if (XMLHTTP.readyState == 4)
{
var R = document.getElementById("nomi");
R.innerHTML = XMLHTTP.responseText;
}
}
function QualeBrowser(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!");
}
}
-------------------------------
la cella è id="nomi"
il fatto è che io conosco asp ma javascript e ajax zero.