Questo dovrebbe essere compatibile cn tutti i browser. Esistono TANTISSIMI redirect..te ne dico uno a caso! tieni conto che esiste il semplice location.href, cmq.
NELL'HEAD:
codice:
<script language="JavaScript1.2">
var duration=2;
var message = "";
var font_size = 2;
var font_face = "verdana";
var NS6redirection = "http://sito.it/index1.html";
var bar_width = 0;
var bar_height = 0;
var centered = (screen.width) ? (screen.width-bar_width)/2 : 0;
function postaction(){
window.location="http://sito.it/index1.html"
}
var clipright=0
var widthIE=0
var widthNS=0
function initializebar(){
if (document.all){
baranchor.style.visibility="visible"
widthIE=bar.style.pixelWidth
startIE=setInterval("increaseIE()",50)
}
if (document.layers){
widthNS=document.baranchorNS.document.barbackgroundNS.clip.width
document.baranchorNS.document.barNS.clip.right=0
document.baranchorNS.visibility="show"
startNS=setInterval("increaseNS()",50)
}
}
function increaseIE(){
bar.style.clip="rect(0 "+clipright+" auto 0)"
window.status=""
if (clipright<widthIE)
clipright=clipright+(widthIE/(duration*20))
else{
window.status=''
clearInterval(startIE)
postaction()
}
}
function increaseNS(){
if (clipright<202){
window.status=""
document.baranchorNS.document.barNS.clip.right=clipright
clipright=clipright+(widthNS/(duration*20))
}
else{
window.status=''
clearInterval(startNS)
postaction()
}
}
window.onload=initializebar
</script>
NEL BODY:
codice:
<script language="JavaScript1.2">
if(document.layers){
document.write('<font size='+font_size+' face="'+font_face+'">' +message+ '</font>
');
document.write('<ilayer name="baranchorNS" visibility="hide" width='+bar_width+' height='+bar_height+'>')
document.write('<layer name="barbackgroundNS" bgcolor=black width='+bar_width+' height='+bar_height+' z-index=10 left='+centered+' top=0></layer>')
document.write('<layer name="barNS" bgcolor=blue width='+bar_width+' height='+bar_height+' z-index=11 left='+centered+' top=0></layer>')
document.write('</ilayer>')
}
else if (document.all){
document.write('<font size='+font_size+' face="'+font_face+'">' +message+ '</font>');
document.write('<div id="baranchor" style="position:relative;width:'+bar_width+'px;height:'+bar_height+'px;visibility:hidden;">')
document.write('<div id="barbackground" style="width:'+bar_width+'px;height:'+bar_height+'px;z-index:9"></div>')
document.write('<div id="bar" style="width:'+bar_width+'px;height:'+bar_height+'px;z-index:10"></div>')
document.write('</div>')
}
else if (document.getElementById){
document.write('<font size='+font_size+' face="'+font_face+'">' +message+ '</font>');
document.write('<META http-equiv="REFRESH" CONTENT="'+duration+';URL='+NS6redirection+'">')
}
</script>