HTML bunu yapamaz301 atlamaEvet, ama geçilebilir
5 saniye sonra, aynı dizindeki hello.html dosyaya otomatik olarak atlar (kendi ihtiyaçlarınıza göre değiştirin).
Aşağıdaki beş örnek detaylı olarak gösterilmiştir, bu örneklerin ana işlevi şunlardır: 5 saniye sonra, aynı dizindeki hello.html (kendi ihtiyaçlarınıza göre değiştirin) dosyalarına otomatik olarak geçin.
1) HTML uygulaması <head> <!-- Aşağıdaki yol sadece yenileniyor ve başka sayfalara geçmiyor --> <meta http-equiv="refresh" content="10"> <!-- Diğer sayfalara düzenli olarak --> <meta http-equiv="refresh" content="5;url=hello.html"> </head>
Artılar: Basit Eksiler: Struts Tiles'ta bulunmuyor 2) JavaScript uygulaması <script language="javascript" type="text/javascript"> Aşağıdaki yöntem doğrudan atlar window.location.href='hello.html'; Aşağıdaki düzenli bir sıçrama setTimeout("javascript:location.href='hello.html'", 5000); </script>
Artılar: Esnek, daha fazla diğer işlevi birleştirebiliyor Eksiler: Farklı tarayıcılardan etkileniyor
3) ters geri sayım (IE) ile javascript uygulaması <script language="javascript" type="text/javascript"> var second = document.getElementByIdx_x('totalSecond').textContent; setInterval("yönlendirme()", 1000); fonksiyon yönlendirme()
{ document.getElementByIdx_x('totalSecond').textContent = --second; eğer (ikinci < 0) location.href = 'hello.html';
} </script>
Artılar: Daha kullanıcı dostu Dezavantajlar: Firefox desteklemez (firefox span, div vb. için innerText özelliklerini desteklemez)
3') karşılıklı javascript uygulamasını (Firefox) içerir <span id="totalSecond">5</span> <script language="javascript" type="text/javascript"> var second = totalSecond.innerText; setInterval("yönlendirme()", 1000); function redirect(){ totalSecond.innerText=--second; if(second<0) location.href='hello.html';
} </script>
4) Firefox'un innerText'i desteklememesi sorununu düzeltin <span id="totalSecond">5</span> <script language="javascript" type="text/javascript"> if(navigator.appName.indexOf("Explorer") > -1){ document.getElementByIdx_x('totalSecond').innerText = "metnim innerText"; } else{ document.getElementByIdx_x('totalSecond').textContent = "metnim textContent";
} </script>
5) Entegrasyon 3) ve 3')
<span id="totalSecond">5</span>
<script language="javascript" type="text/javascript"> var second = document.getElementByIdx_x('totalSecond').textContent;
if (navigator.appName.indexOf("Explorer") > -1) { second = document.getElementByIdx_x('totalSecond').innerText; } else { second = document.getElementByIdx_x('totalSecond').textContent;
}
setInterval("yönlendirme()", 1000); function redirect() { if (ikinci < 0) { location.href = 'hello.html'; } else { if (navigator.appName.indexOf("Explorer") > -1) { document.getElementByIdx_x('totalSecond').innerText = second--; } else { document.getElementByIdx_x('totalSecond').textContent = saniye--; }
}
} </script>
|