Ciao a tutti andate su questa pagina per favore
http://www.museotaranto.it/mappa/
Il sito l'ho modificato in modo che quando l'utente clicca su un link la lente resta nella posizione attuale e non torna ogni volta indietro. Questo l'ho fatto attraverso ajax e il codice javascript è il seguente
var req;
var ajaxable;
var ajaxname = "ajaxable";
function getAjaxable(){
ajaxable = document.getElementById(ajaxname);
}
function ahah(url) {
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
if (req) {
req.onreadystatechange = function() {
ahahDone();
};
req.open('GET', url, true);
req.send("");
}
}
function ahahDone(){
if(req.readyState == 4){
if(req.status == 0)
buildPagina();
else
ajaxable.innerHTML="ahah error";
}
}
function buildPagina(){
ajaxable.innerHTML = analizzaTesto(req.responseText);
}
function analizzaTesto(testo){
var regexp = new RegExp("([\\w\\W]*)");
regpag = regexp.exec(testo);
if(regpag==null)
return "";
else
return regpag[1];
}
Il problema è che con firefox e ie 6 funziona mentre con ie 7 funziona solo lato server, mentre lato client non funziona, da un messaggio di errore. In altre parole in rete funziona con tutti i browser mentre localmente con ie 7 non funziona e a me serve che funzioni localmente.
Spero di essere stato chiaro,
ciao ciao