Ciao a tutti, sono un novellino del javascript e in quanto tale ho già sbattuto il muso contro un muro...
Ho fatto il seguente script che viene chiamato da un evento "onclick" sulla finestra "A" lo scopo è quello di aprire la finestra "B" e popolarla con uno script in php.
var switchCategoria =
{
cambiaCategoria: function(categoria)
{
window_categorie = window.open("categorie.html", "_self");
var xmlhttp=switchCategoria.GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
xmlhttp.open("GET","categorie.php",true);
xmlhttp.send(null);
xmlhttp.onreadystatechange = function risposta()
{
if (xmlhttp.readyState==4)
{
window_categorie.document.getElementById("containe r_box_categorie").innerHTML = xmlhttp.responseText;
};
}
},
GetXmlHttpObject : function()
{
if (window.XMLHttpRequest)
{
//browser "normali"
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
//browser bastardi
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
}
Il tutto NON funziona... e io non so piu dove sbattere la testa !!
Qualcuno può darmi una mano ??
Grazie.