Window.open

参数:

sUrl : 可选项。字符串(String)。指定要被加载的HTML文档的 URL 地址。假如无指定值,则 about:blank 的新窗口会被显示。
sName : 可选项。字符串(String)。 指定打开的窗口的名字。这个名字可以用于 form a 对象的 TARGET 属性。此名字也可以使用下列通用名称:
_media : IE6.0在浏览器左边的媒体面板内打开 sUrl
_blank :  在新窗口中打开 sUrl
_parent :  在当前框架的父框架内打开。假如当前框架无父框架,此参数值等同于 _self
_search : IE5.0在浏览器左边的搜索面板内打开 sUrl
_self :  sUrl 在当前窗口中打开,覆盖当前文档。
_top :  在所有框架之外的最顶层窗口中打开 sUrl 。假如当前窗口无框架结构,此参数值等同于 _self
sFeatures : 可选项。字符串(String)。 指定窗口装饰样式。使用下面的值。多个之间用逗号隔开。只有当新的浏览器窗口被建立时,此参数的设置才会发生作用。
channelmode = { yes | no | 1 | 0 }  指定是否将窗口显示为频道模式。默认值为 no
directories = { yes | no | 1 | 0 }  指定是否显示「链接」按钮。默认值为 yes
fullscreen = { yes | no | 1 | 0 }  指定是否以全屏方式显示窗口。默认值为 no 。要小心使用全屏模式,因为这种模式会隐藏浏览器窗口的标题栏和菜单。如果没有在页面内提供关闭窗口的功能,用户可以使用 ALT+F4 快捷键关闭窗口。
height = number  设置窗口的高度。最小值为 100
left = number 设置窗口左上角相对于桌面的横坐标。单位为像素( px )。
width = number  设置窗口的宽度。最小值为 100
top = number 设置窗口左上角相对于桌面的纵坐标。单位为像素( px )。
location = { yes | no | 1 | 0 }  设置是否显示浏览器窗口的地址栏。默认值为 yes
menubar = { yes | no | 1 | 0 }  设置是否显示浏览器窗口的菜单栏。默认值为 yes
resizable = { yes | no | 1 | 0 }  设置窗口是否允许被用户改变尺寸。默认值为 yes
scrollbars = { yes | no | 1 | 0 }  设置窗口是否可以具有滚动条。默认值为 yes
status = { yes | no | 1 | 0 }  设置是否显示浏览器窗口的状态栏。默认值为 yes
titlebar = { yes | no | 1 | 0 }  设置是否显示浏览器窗口的标题栏。除非调用程序是HTML应用程式( HTA )或被信任的对话框,否则此参数将被忽略。默认值为 yes
toolbar = { yes | no | 1 | 0 }  设置是否显示浏览器窗口的工具条。默认值为 yes
bReplace : 可选项。布尔值(Boolean)。false | true
false : 新打开的文档覆盖历史列表里的当前文档。
true : 文新打开的文档被简单的添加到历史列表的最后。


a.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>a.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
	function selectKeHu(){
		window.open("b.html","_blank","height=200,width=400,status=no,toolbar=no,menubar=no,location=no");
	}
	function addValue(value){
		document.getElementById("userName").value = value;
	}
</script>
  </head>
  
  <body>
    选择客户<input type="text" name="userName" οnclick="selectKeHu()" id="userName">
  </body>
</html>

b.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>b.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<script type="text/javascript">
		function change(value){
			window.opener.addValue(value);//获得a.html的引用,再调用a,html中的函数
		}
	</script>
  </head>
  
  <body>
    <table>
    	<tr>
    		<td>法师</td>
    		<td><input type="button" value="选择" οnclick="change('法师')"></td>
    	</tr>
    	<tr>
    		<td>萨满</td>
    		<td><input type="button" value="选择" οnclick="change('萨满')"></td>
    	</tr>
    </table>
  </body>
</html>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值