zoukankan      html  css  js  c++  java
  • 在javascrit中怎样来刷新页面

    a页面里iframe了个b页面,我想实现在b页面里一个按钮,一按就刷新a页面,也就是父页面,不是只刷新iframe里面的b页面 哦~

    请问b页面里的<input type="button" class="btn" value=" 返 回 " onclick="history.back();">那个onclick 要怎么写呢?啊哈

    答案是:parent.location.reload() ;

    以下是网上的:

    十一种刷新按钮的方法。很不错的,经常上网要找。哈哈。这下放这里了。  
    <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="location.assign(location)">
    <input type=button value=刷新 onclick="document.execCommand('Refresh')">
    <input type=button value=刷新 onclick="window.navigate(location)">
    <input type=button value=刷新 onclick="location.replace(location)">
    <input type=button value=刷新 onclick="window.open('自身的文件','_self')">
    <input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)> 
    <OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
    <form action="自身的文件">
    <input type=submit value=刷新>
    </form>
    <a id=a1 href="自身的文件"></a>
    <input type=button value=刷新 onclick="a1.click()">

    iframe中刷新顶层窗口

    MAIN.JSP页面使用IFRAME来内嵌了一个内容页面(A.JSP),如何实现用户点击A.JSP页面的连接时,能更新它的父页面(MAIN.JSP)的内容呢? 
    window.parent.location.reload();

    window.parent.location.href="地址";

    window.top   当前窗口的最顶层窗口

  • 相关阅读:
    tp5 查询问题 字段自增 字段比较
    七牛云 {"error":"no such domain"}
    mac 命令
    跟微信公众号一起来学api安全
    vue 运行别人项目
    php sha1withrsa
    thinkphp5 使用路由下分页 form表单 搜索
    P2134 百日旅行 (斜率优化,DP)
    [USACO Section 4.4]追查坏牛奶Pollutant Control (最小割)
    [HAOI2007] 理想的正方形 (单调队列)
  • 原文地址:https://www.cnblogs.com/zhoushihui/p/5711734.html
Copyright © 2011-2022 走看看