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

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

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

    tinguo002

     

    iframe 刷新

    JS實現刷新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為其它網站地址(跨域操作時)


    <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,用于顯示內容?,F在當內容內容添加后,在鏈接列表中添加了一條記錄,則需要刷新列表iframe。


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


    使用window.parent.frames["列表iframe名字"].location="列表url"即可進刷新列表iframe,而內容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"; //沒變化,沒動靜


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


    這里需要補充說明的是:


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


    但是可以這樣


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


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



    自動刷新頁面



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


    1)
    <meta
    http-equiv="refresh"content="10;url=跳轉的頁面">
    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>")


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



    刷新頁面實現方式總結(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參數或者表單傳值判斷是否發生某個操作,然后利用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"/>


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


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



    頁面定時刷新功能實現


    有三種方法:
    1,在html中設置:
    <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>
    一秒一次



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



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


    A窗口打開B窗口


    然后在B里面提交數據至C窗口


    最后要刷新A窗口


    并且關閉B窗口


    幾個javascript函數


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


    //第二個刷新父頁面的函數


    <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>



    歡迎大家訪問我的個人網站 萌萌的IT人

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


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


    網站導航:
     

    導航

    統計

    常用鏈接

    留言簿(1)

    隨筆分類

    隨筆檔案

    收藏夾

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 97碰公开在线观看免费视频| 中文字幕的电影免费网站| 日韩人妻无码精品久久免费一| 国产亚洲精品AA片在线观看不加载| 日韩精品视频在线观看免费| 四虎永久在线精品免费影视 | 久久免费国产视频| 亚洲精品少妇30p| 国产偷伦视频免费观看| 亚洲bt加勒比一区二区| 最近免费中文字幕大全高清大全1 最近免费中文字幕mv在线电影 | 色欲色欲天天天www亚洲伊| 国产美女精品视频免费观看| 国产成人精品久久亚洲高清不卡 | 亚洲人成无码www久久久| 三级黄色片免费看| 亚洲综合免费视频| 毛片a级毛片免费观看免下载| 美女黄频免费网站| 亚洲中文字幕无码一区| 最近免费中文字幕mv电影 | 国产精品九九久久免费视频| 久久精品国产亚洲香蕉| 日本亚洲免费无线码| 欧美色欧美亚洲另类二区| 亚洲精品无码精品mV在线观看| 99热免费在线观看| 亚洲欧美日韩综合俺去了| 国产亚洲午夜高清国产拍精品 | 亚洲尹人香蕉网在线视颅| 最近免费中文字幕大全视频 | 成人永久免费高清| 中国好声音第二季免费播放| 亚洲综合色丁香麻豆| 日韩特黄特色大片免费视频| 青青操在线免费观看| 在线a亚洲老鸭窝天堂av高清| 国产日韩成人亚洲丁香婷婷| 天天影视色香欲综合免费| 国产成人亚洲精品无码AV大片| 亚洲国产精品一区|