Salve, la cosa è proprio strana, vorrei capire cosa mi sfugge, il seguente codice in locale funziona ma online no....:
codice:
var imgs = 0;
window.addEvent("domready", function(){
var numR = -1;
var W = screen.width;
var H = screen.height;
$("content").setStyles({"left": (W - $("content").getStyle("width").toInt() )/2+"px", "top":"0"});
function show(){
imgs = 1;
var req = new Request({
url:"js/imgs.xml",
update:$("box_show"),
onRequest:function(){ $("ajax").set("html","WAITING FOR ANSWER...");
var loader = new Element("div",{
"id":"loader",
"styles":{ "width":"31px", "height":"31px", "border":"0px solid red",
"background-image":"url(imgs/ajax-loader.gif)", "position":"absolute",
"top":"370px", "left":"455px"
}
}).inject($("content"));
},//END onRequest
onSuccess:function(txt, xml){
$("loader").destroy();
var root = xml.documentElement;
//$("ajax").set("html","OK!");
imgs = root.getElementsByTagName("img");
num = Math.round( Math.random() * (imgs.length-1) );
img = (Browser.Engine.trident)? imgs[num].text : imgs[num].textContent;
$("ajax").set("html", "OK - "+root.getElementsByTagName("img").length+" - "+img+" - "+num);
$("box_show").setStyle("background-image", "url(imgs/"+img+")");
},//END onSuccess
onFailure:function(){ /*$("ajax").set("html","ERROR");*/ }
}).send(null);
}//END show()
function show_slide(){
num = Math.round( Math.random() * (imgs.length-1) );
while(num==numR){ num = (num+1)%imgs.length; }
numR = num;
img = (Browser.Engine.trident)? imgs[num].text : imgs[num].textContent;
$("box_show").setStyle("background-image", "url(imgs/"+img+")");
$("ajax").set("html", img);
}
show();
show_slide.periodical(2000);
});//END "domready"
Le immagini sono state caricate, non capisco proprio.