请有人告诉我window.open()
中的这个窗口名称是标题名称还是java脚本语言中的一些ID?
答案 0 :(得分:4)
windowName
要给新窗口的名称。该名称可用于再次引用此窗口。
打开窗口后,你会想要用它做各种各样的事情,例如移动它然后你可以做
<html>
<head>
<title>Window Example</title>
</head>
<SCRIPT language="JavaScript1.2">
function poponload()
{
testwindow= window.open ("", "mywindow");
alert('I will move window to 0,0');
testwindow.moveTo(0,0);
}
</SCRIPT>
<body onload="javascript: poponload()">
<H1>Window Example</H1>
</body>
</html>
并且否它的window title
不同。
答案 1 :(得分:2)
window.open(strUrl, strWindowName [, strWindowFeatures]);
<强> strWindowName 强>
这是仅命名的字符串 新窗户。这样的字符串可以用来 成为链接和表单的目标<a>
元素的target属性 或指定<form>
。这个 字符串参数不应包含 任何空白。strWindowName
没有指定新的标题 窗口。
答案 2 :(得分:2)
<强> SNAME 强>
Optional. String that specifies the name of the window. This name is used
as the value for the TARGET attribute on a form or an anchor element.
_blank
The sURL is loaded into a new, unnamed window.
_media
The url is loaded in the Media Bar in Microsoft Internet Explorer 6.
Windows XP Service Pack 2 (SP2) and later. This feature is no longer
supported. By default the url is loaded into a new browser window or
tab.
_parent
The sURL is loaded into the current frame's parent. If the frame has
no parent, this value acts as the value _self.
_search
Disabled in Windows Internet Explorer 7, see Security and Compatibility
in Internet Explorer 7 for details. Otherwise, the sURL is opened in the
browser's search pane in Internet Explorer 5 or later.
_self
The current document is replaced with the specified sURL.
_top
sURL replaces any framesets that may be loaded. If there are no framesets
defined, this value acts as the value _self.