zoukankan      html  css  js  c++  java
  • [转]window.showModalDialog 缓存和返回值的问题

    这次在开发过程中用到了模态弹出对话框,但这个函数会有缓存,很是烦恼,在网上查了查相关的资料,发现了一种解决的方法,在这里记录下,主要是在给弹出的窗口的页面加上个时间参数,这样就不会有缓存了,如下:

    一、缓存

    1、

    <meta http-equiv="pragma"   content="no-cache" />  
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate" />  
    <meta http-equiv="expires" content="Wed,26 Feb 1997 08:21:57 GMT" />

    2、

    <script language='javascript'>

    var time = new Date();

    window.showModalDialog("newWin.html?time="+time,"","");

    </script>

    二、返回值

    1、被调用的fish.html

    <html>

    <title>html</title>

    <head>

    <script>  
      function   sendTo()  {  
          window.returnValue   =   “deepfish”;
         window.close()  ;
      }  
    </script>

    </head>  
    <body>  
    <form>  
        <input   value="返回"   type=button   onclick="sendTo()">  
    </form>

    </body>

    </html>

    2、调用者html

    <html>

    <body>

    <script>

      var   tmp   =   window.showModalDialog("fish.htm")  
      alert(tmp);  

    </script>

    <body>

    </html>

    来源:http://www.cnblogs.com/xmphoenix/archive/2012/02/11/2347037.html

  • 相关阅读:
    SyntaxError: Non-ASCII character 'xe7' in file解决方法
    python实现微信打飞机游戏
    ubuntu 系统出错一览
    MVC的特点
    架构
    策略模式
    bin
    使用XSLT实现Word下载
    <a>标签的href属性
    call-template和apply-templates
  • 原文地址:https://www.cnblogs.com/seasons1987/p/2872961.html
Copyright © 2011-2022 走看看