国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
一些頁(yè)面自動(dòng)跳轉(zhuǎn)的實(shí)現(xiàn)
功能:5秒后,自動(dòng)跳轉(zhuǎn)到同目錄下的02view.html文件
 
1)html的實(shí)現(xiàn)
<head>
<meta http-equiv="refresh" content="5;url=02view.html">
</head>

優(yōu)點(diǎn):簡(jiǎn)單
缺點(diǎn):Struts Tiles中無(wú)法使用
 
2)javascript的實(shí)現(xiàn)
<script language="javascript" type="text/javascript">
   setTimeout(
"javascript:location.href='02view.html'"5000); 
</script>

優(yōu)點(diǎn):靈活,可以結(jié)合更多的其他功能
缺點(diǎn):受到不同瀏覽器的影響
 
3)結(jié)合了倒數(shù)的javascript實(shí)現(xiàn)(IE)
<span id="totalSecond">5</span>

<script language="javascript" type="text/javascript">
var second = totalSecond.innerText;
setInterval(
"redirect()"1000);
function redirect(){ 
totalSecond.innerText
=--second; 
if(second<0) location.href='02view.html';
}
</script>

優(yōu)點(diǎn):更人性化
缺點(diǎn):firefox不支持(firefox不支持span、div等的innerText屬性)
 
3')結(jié)合了倒數(shù)的javascript實(shí)現(xiàn)(firefox)
<script language="javascript" type="text/javascript">
    
var second = document.getElementById('totalSecond').textContent;
    setInterval(
"redirect()"1000);
    
function redirect()
    {
        document.getElementById('totalSecond').textContent 
= --second;
        
if (second < 0) location.href = '02view.html';
    }
</script>

4)解決Firefox不支持innerText的問(wèn)題
<span id="totalSecond">5</span>

<script language="javascript" type="text/javascript">
if(navigator.appName.indexOf("Explorer"> -1){
    document.getElementById('totalSecond').innerText 
= "my text innerText";
else{
    document.getElementById('totalSecond').textContent 
= "my text textContent";
}
</script>

5)整合3)和3')
<span id="totalSecond">5</span>

<script language="javascript" type="text/javascript">
    
var second = document.getElementById('totalSecond').textContent;

    
if (navigator.appName.indexOf("Explorer"> -1)
    {
        second 
= document.getElementById('totalSecond').innerText;
    } 
else
    {
        second 
= document.getElementById('totalSecond').textContent;
    }


    setInterval(
"redirect()"1000);
    
function redirect()
    {
        
if (second < 0)
        {
            location.href 
= '02view.html';
        } 
else
        {
            
if (navigator.appName.indexOf("Explorer"> -1)
            {
                document.getElementById('totalSecond').innerText 
= second--;
            } 
else
            {
                document.getElementById('totalSecond').textContent 
= second--;
            }
        }
    }
</script>
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
在網(wǎng)頁(yè)中顯示文本 (JavaScript)
etElementByID getElementsByName getElementsBy...
innerHTML用法
innerText 與 innerHtml的區(qū)別 (一)
(5)JavaScript獲取表格單元格內(nèi)容
span的賦值與取值
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服