zoukankan      html  css  js  c++  java
  • window.returnValue = 00000000; window.close();

    window.returnValue使用方法 

    2010-09-13 09:49:55|  分类: ASP.NET |  标签:returnvalue  window  返回  html  |字号订阅

     
     
    returnValue是javascript中html的window对象的属性,目的是返回窗口值,当用window.showModalDialog函数打开一个IE的模式窗口(模式窗口知道吧,就是打开后不能操作父窗口,只能等模式窗口关闭时才能操作)时,用于返回窗口的值,下面举个例子:

        1、parent.html

     

    Html代码 复制代码//father.html   <HTML>  <HEAD>  <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">  <TITLE></TITLE>  <script language="javascript">    function showmodal(){   var ret = window.showModalDialog("child.htm",null,"dialogWidth:350px;dialogHeight:350px;help:no;status:no");       if (ret){alert('子窗口返回真!');       }else{            alert('子窗口返回假!');      }   }   </script>  </HEAD>    <BODY>  <INPUT id=button1 type=button value=Button name=button1 onclick="showmodal();">  </BODY>  </HTML> 
    //father.html  <HTML>  <HEAD>  <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">  <TITLE></TITLE>  <script language="javascript">    function showmodal(){  var ret = window.showModalDialog("child.htm",null,"dialogWidth:350px;dialogHeight:350px;help:no;status:no");      if (ret){alert('子窗口返回真!');      }else{           alert('子窗口返回假!');     }  }  </script>  </HEAD>    <BODY>  <INPUT id=button1 type=button value=Button name=button1 onclick="showmodal();">  </BODY>  </HTML>  
         2、child.html Html代码 复制代码 //child.html    <HTML>   <HEAD>   <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">   <TITLE></TITLE>   <script language="javascript">   function trans(tag){       if (tag==0){           window.returnValue=false;       } else{           window.returnValue =true;      }       window.close();    }    </script>   </HEAD>   <BODY>      <INPUT id=button1 type=button value="返回真" name=button1 onclick="trans(1)">   <INPUT id=button2 type=button value="返回假" name=button2 onclick="trans(0)">      </BODY>   </HTML>  
    //child.html  <HTML>  <HEAD>  <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">  <TITLE></TITLE>  <script 
  • 相关阅读:
    介绍Shiro Annotation及Shiro标签的用法
    SpringMVC+Apache Shiro+JPA(hibernate)案例教学(四)基于Shiro验证用户权限,且给用户授权
    SpringMVC+Apache Shiro+JPA(hibernate)案例教学(一)整合配置
    Spring MVC之@RequestMapping 详解
    vimrc
    sk_buff深度解析
    ieee80211ax简介
    新基地
    dos格式迭代转为unix
    ath10k MAC地址
  • 原文地址:https://www.cnblogs.com/guanghuiqq/p/2618325.html
Copyright © 2011-2022 走看看