<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    tinguo002

     

    iframe 刷新

    JS實現(xiàn)刷新iframe的方法



    <iframe src="1.htm" name="ifrmname" id="ifrmid"></iframe>


    方案一:用iframe的name屬性定位


    <input type="button" name="Button"
    value="Button"
    onclick="document.frames('ifrmname').location.reload()">


      或


    <input type="button" name="Button"
    value="Button"
    onclick="document.all.ifrmname.document.location.reload()">


      方案二:用iframe的id屬性定位


    <input type="button" name="Button"
    value="Button"
    onclick="ifrmid.window.location.reload()">


      終極方案:當iframe的src為其它網(wǎng)站地址(跨域操作時)


    <input type="button" name="Button"
    value="Button"
    onclick="window.open(document.all.ifrmname.src,'ifrmname','')">





    代碼如下:<input type=button value=刷新 onclick="history.go(0)">


    代碼如下:<input type=button value=刷新 onclick="location.reload()">


    代碼如下:<input type=button value=刷新 onclick="location=location">


    代碼如下:<input type=button value=刷新
    onclick="window.navigate(location)">


    代碼如下:<input type=button value=刷新 onclick="location.replace(location)">


    下面這三種我就不知道該怎么用了,就把代碼放在下面吧,哪位要是會的話,可教教大家。


    <input type=button value=刷新
    onclick="document.execCommand(@#Refresh@#)">


    <input type=button value=刷新
    onclick="window.open(@#自身的文件@#,@#_self@#)">


    <input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>






    父頁面中存在兩個iframe,一個iframe中是一個鏈接列表,其中的鏈接指向另一個iframe,用于顯示內(nèi)容。現(xiàn)在當內(nèi)容內(nèi)容添加后,在鏈接列表中添加了一條記錄,則需要刷新列表iframe。


    在內(nèi)容iframe的提交js中使用parent.location.reload()將父頁面全部刷新,因為另一個iframe沒有默認的url,只能通過列表選擇,所以只顯示了列表iframe的內(nèi)容。


    使用window.parent.frames["列表iframe名字"].location="列表url"即可進刷新列表iframe,而內(nèi)容iframe在提交后自己的刷新將不受影響。








    document.frames("refreshAlarm").location.reload(true); //ok


    document.frames("refreshAlarm").document.location.reload(true); //ok


    document.frames("refreshAlarm").document.location="/public/alarmsum.asp";//ok


    document.getElementByIdx_x("refreshAlarm").src="/public/alarmsum.asp"
    mce_src="/public/alarmsum.asp"; //ok


    document.frames("refreshAlarm").src="/public/alarmsum.asp"
    mce_src="/public/alarmsum.asp"; //沒變化,沒動靜


    注意區(qū)別,document.all.refreshAlarm 或 document.frames("refreshAlarm")
    得到的是information.asp頁面中那個iframe標簽,所以對src屬性操作有用。
    document.frames("refreshAlarm").document得到iframe里面的內(nèi)容,也就是"/public/alarmsum.asp"中的內(nèi)容。


    這里需要補充說明的是:


    采用document.getElementByIdx_x獲取后reload是不可以的


    但是可以這樣


    var myiframe = document.getElementByIdx_x("iframe1");


    myiframe.src = myiframe.src; //這樣同樣可以起到刷新的效果。



    自動刷新頁面



    javascript(js)自動刷新頁面的實現(xiàn)方法總結(jié)2008-04-18 13:24
    自動刷新頁面的實現(xiàn)方法總結(jié):


    1)
    <meta
    http-equiv="refresh"content="10;url=跳轉(zhuǎn)的頁面">
    10表示間隔10秒刷新一次
    2)
    <script
    language=''javascript''>
    window.location.reload(true);
    </script>
    如果是你要刷新某一個iframe就把window給換成frame的名字或ID號
    3)
    <script
    language=''javascript''>
    window.navigate("本頁面url");
    </script>
    4>


    function
    abc()
    {
    window.location.href="/blog/window.location.href";
    setTimeout("abc()",10000);
    }


    刷新本頁:
    Response.Write("<script
    language=javascript>window.location.href=window.location.href;</script>")


    刷新父頁:
    Response.Write("<script
    language=javascript>opener.location.href=opener.location.href;</script>")


    轉(zhuǎn)到指定頁:
    Response.Write("<script
    language=javascript>window.location.href='yourpage.aspx';</script>")



    刷新頁面實現(xiàn)方式總結(jié)(HTML,ASP,JS)
    'by aloxy


    定時刷新:
    1,<script>setTimeout("location.href='url'",2000)</script>


    說明:url是要刷新的頁面URL地址
    2000是等待時間=2秒,


    2,<meta name="Refresh" content="n;url">


    說明:
    n is the number of seconds to wait before loading the specified
    URL.
    url is an absolute URL to be
    loaded.
    n,是等待的時間,以秒為單位
    url是要刷新的頁面URL地址


    3,<%response.redirect url%>


    說明:一般用一個url參數(shù)或者表單傳值判斷是否發(fā)生某個操作,然后利用response.redirect 刷新。


    4,刷新框架頁
       〈script
    language=javascript>top.leftFrm.location.reload();parent.frmTop.location.reload();</script〉


    彈出窗體后再刷新的問題



    Response.Write("<script>window.showModalDialog('../OA/SPCL.aspx',window,'dialogHeight:
    300px; dialogWidth: 427px; dialogTop: 200px; dialogLeft:
    133px')</script>");//open
                
    Response.Write("<script>document.location=document.location;</script>");


    在子窗體頁面代碼head中加入<base target="_self"/>


    刷新的內(nèi)容加在    if (!IsPostBack) 中


    在框架頁中右面刷新左面
        //刷新框架頁左半部分
        Response.Write("<script
    language=javascript>");
       
    Response.Write("parent.left.location.href='PayDetailManage_Left.aspx'");
       
    Response.Write("</script>");



    頁面定時刷新功能實現(xiàn)


    有三種方法:
    1,在html中設(shè)置:
    <title>xxxxx</title>之後加入下面這一行即可!
    定時刷新:<META
    HTTP-EQUIV="Refresh" content="10">
    10代表刷新間隔,單位為秒


    2.jsp
    <% response.setHeader("refresh","1"); %>
    每一秒刷新一次


    3.使用javascript:
    <script
    language="javascript">
    setTimeout("self.location.reload();",1000);
    <script>
    一秒一次



    頁面自動跳轉(zhuǎn):
    1,在html中設(shè)置:
    <title>xxxxx</title>之後加入下面這一行即可!
    定時跳轉(zhuǎn)并刷新:<meta
    http-equiv="refresh"
    content="20;url=http://自己的URL">,
    其中20指隔20秒后跳轉(zhuǎn)到http://自己的URL 頁面。



    點擊按鈕提交表單后刷新上級窗口


    A窗口打開B窗口


    然后在B里面提交數(shù)據(jù)至C窗口


    最后要刷新A窗口


    并且關(guān)閉B窗口


    幾個javascript函數(shù)


    //第一個自動關(guān)閉窗口
    <script language="javascript">
    <!--
    function
    clock(){i=i-1
    document.title="本窗口將在"+i+"秒后自動關(guān)閉!";
    if(i>0)setTimeout("clock();",1000);
    else
    self.close();}
    var i=2
    clock();
    //-->
    </script>


    //第二個刷新父頁面的函數(shù)


    <script
    language="javascript">
    opener.location.reload();
    </script>



    //第三個打開窗口


    <script language="javascript">
    function
    show(mylink,mytitle,width,height)
    {mailwin=window.open(mylink,mytitle,'top=350,left=460,width='+width+',height='+height+',scrollbars=no')}
    </script>



    歡迎大家訪問我的個人網(wǎng)站 萌萌的IT人

    posted on 2013-06-02 21:39 一堣而安 閱讀(643) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     

    導(dǎo)航

    統(tǒng)計

    常用鏈接

    留言簿(1)

    隨筆分類

    隨筆檔案

    收藏夾

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: jizz免费一区二区三区| 亚洲精品天堂在线观看| 国产日韩精品无码区免费专区国产 | 一级做a爱过程免费视| 亚洲欧洲久久久精品| 青青草97国产精品免费观看| 亚洲av午夜成人片精品电影| 18以下岁毛片在免费播放| 亚洲AV一宅男色影视| 97公开免费视频| 亚洲av永久无码精品天堂久久 | 精品国产麻豆免费人成网站| 亚洲色精品88色婷婷七月丁香 | 视频一区二区三区免费观看| 亚洲国产精品激情在线观看| 91成人免费福利网站在线| 亚洲精品V欧洲精品V日韩精品| 无码国产精品一区二区免费16 | 亚洲最新在线视频| 国产美女精品视频免费观看 | 麻豆安全免费网址入口| 自拍偷自拍亚洲精品情侣| 免费91麻豆精品国产自产在线观看 | 国产V亚洲V天堂A无码| 99在线精品视频观看免费| 亚洲色大网站WWW永久网站| 亚洲精品无码久久毛片| 日韩中文字幕免费视频| 亚洲第一区二区快射影院| 亚洲AV无码乱码在线观看性色扶| 中文字字幕在线高清免费电影| 亚洲黄色免费在线观看| 国产成人免费片在线视频观看 | 中文字幕无码不卡免费视频| 污污视频免费观看网站| 亚洲一区二区三区首页| 中文字幕手机在线免费看电影 | 一级特黄aa毛片免费观看| 亚洲日本VA午夜在线电影| 在线亚洲人成电影网站色www | 久热免费在线视频|