窗口打开 Javascript(参数错误)
所以我试图在 IE8 中打开一个弹出窗口。到目前为止还没有运气。它告诉我 window.open() 中的参数错误,但是当我查看 window.open() 的所有参数时,一切看起来都是正确的,有建议吗?
<html>
<body>
<a href="#" id="one">Click Here</a>
<script language="javascript">
var vid1 = document.getElementById('video1');
if(vid1.addEventListener)
{
vid1.addEventListener('click', function(e){
videoOne();
},true);
}
else
{
vid1.attachEvent('click', videoOne);
}
function videoOne(){
window.open("http://www.yahoo.com","Case Study 1",
"location=1,status=1,scrollbars=1,width=650,height=400");
}
</script>
</body>
</html>
So I'm trying to open a pop up window in IE8. So far no luck. It's telling me I have the wrong parameters in window.open() but when I look at all the parameters for window.open() it all looks right, suggestions?
<html>
<body>
<a href="#" id="one">Click Here</a>
<script language="javascript">
var vid1 = document.getElementById('video1');
if(vid1.addEventListener)
{
vid1.addEventListener('click', function(e){
videoOne();
},true);
}
else
{
vid1.attachEvent('click', videoOne);
}
function videoOne(){
window.open("http://www.yahoo.com","Case Study 1",
"location=1,status=1,scrollbars=1,width=650,height=400");
}
</script>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Internet Explorer 不支持包含空格的窗口名称。
Internet Explorer doesn't support window names with spaces in them.
Quentin 是正确的,尽管 MDN 文档中有关于
window.open< 的更多信息/代码>
:
Quentin is correct, although there is more information in the MDN docs for
window.open
: