相同 name 的窗口可以一直创建新窗口?
“相同 name 的窗口只能创建一个,要想创建多个窗口则 name 不能相同。” 为何我不停地点及按钮(使用window.open()函数)可以一直创建新窗口?
“相同 name 的窗口只能创建一个,要想创建多个窗口则 name 不能相同。” 为何我不停地点及按钮(使用window.open()函数)可以一直创建新窗口?
2016-06-19
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.open</title>
<script type="text/javascript">
function Wopen(){
window.open('http://www.imooc.com','_blank','width=600,height=400,top=100,left=0');
}
function imooc(){
window.open(
'http://www.imooc.com',
'_blank',
'width=300,height=200,menubar=no,toolbar=no, status=no,scrollbars=yes')
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="点击我,打开新窗口!" / >
<input name="button" type="button" onClick="imooc()" value="点击打开慕课网(实验)">
</body>
</html>两个按钮都能创建新窗口,而且可以一直创建新窗口。
举报