javascript被拒绝的简单问题 ( 积分: 50 )

  • 主题发起人 主题发起人 linuxcici
  • 开始时间 开始时间
L

linuxcici

Unregistered / Unconfirmed
GUEST, unregistred user!
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
<title>无标题文档</title>
<script language=&quot;javascript&quot;
type=&quot;text/javascript&quot;>
var new_window
function open_window(){
new_window=window.open(&quot;http://www.21cn.com&quot;,&quot;myweb&quot;)
alert(&quot;the new windows name is: &quot;+ new_window.name )
new_window.focus()
}


</script>
</head>
<body>
<a href=&quot;javascript:void(0)&quot;
onClick=&quot;open_window()&quot;>open www.21cn.com</a>
</body>
</html>

这段代码运行后为什么说new_window.name是被拒绝访问的啊?
 
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
<title>无标题文档</title>
<script language=&quot;javascript&quot;
type=&quot;text/javascript&quot;>
var new_window
function open_window(){
new_window=window.open(&quot;http://www.21cn.com&quot;,&quot;myweb&quot;)
alert(&quot;the new windows name is: &quot;+ new_window.name )
new_window.focus()
}


</script>
</head>
<body>
<a href=&quot;javascript:void(0)&quot;
onClick=&quot;open_window()&quot;>open www.21cn.com</a>
</body>
</html>

这段代码运行后为什么说new_window.name是被拒绝访问的啊?
 
后退
顶部