Ragazzi scusatemi se aprirò un topic identico ad altri ma non riesco veramente a capire
il mio probblema è già stato riscontrato da altri ma usanto php e asp
io stò realizzando un semplicissimo sito tutto html
il mio probblema è una funzione in ajax
che dati come parametri in ingresso nome pagina html e div
va a caricare la pagina nel div
su firefox funziona tutto alla perfezione anche su ie 6
ma su ie 7 da errore alla riga 34
questo è il codice (premetto che non so l'ajax è una funzione che ho trovato in internet)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
function ajaxpage(url, containerid)
{
if (window.XMLHttpRequest) // if Mozilla, Safari etc
var page_request = new XMLHttpRequest()
else if (window.ActiveXObject)
{ // if IE
try
{
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e)
{
try
{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e)
{
}
}
}
else
return false
page_request.onreadystatechange=function()
{
loadpage(page_request, containerid)
}
page_request.open('GET', url, true)
page_request.send(null)
}
function loadpage(page_request, containerid)
{
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=pag e_request.responseText
}
function loadobjs()
{
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++)
{
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1) //Check to see if this object has not already been added to page before proceeding
{
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
if (fileref!="")
{
document.getElementsByTagName("head").item(0).appe ndChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
parte html
[*]Home
non riesco a capire dove sia l'incopatibilità
vi ringrazio in anticipo