window.open不在IE中工作 [英] window.open not working in IE

查看:105
本文介绍了window.open不在IE中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显然,这个对 window.open 的调用在Internet Explorer下无效。我的网站上的Javascript代码没有运行,我认为这是由于该错误。



它告诉我错误是在的那一行,是对window.open的调用,显然这里的一个参数是无效的。

  $('。objeto')。click(
function(){
var center ='height = 380,width = 900,top ='+((screen.width - 900)/ 2)+',left ='+((screen.height - 380)/ 2);
var address = $(this).attr('id' );
window.open(地址,'ver articulo',config = center);
}
);

该网站在Google Chrome和Firefox下运行良好。


<在IE中,你的第二个变量(新窗口的名称)不能有空格。



尝试:

  window.open(address,'Ver_articulo',config = center); 


Apparently, this call to window.open is not valid under Internet Explorer. The Javascript code on my site is not running, I would assume it is due to that error.

The line it tells me the error is on, is the call to window.open, apparently an argument is not valid there.

$('.objeto').click( 
        function() {
            var center   = 'height=380,width=900,top='+((screen.width - 900)/2)+',left='+((screen.height - 380)/2);
            var address = $(this).attr('id');
            window.open (address,'Ver articulo', config=center); 
        }
    );

The site runs fine under both Google Chrome, and Firefox.

解决方案

In IE, you can't have spaces in your second variable (the new window's name).

Try:

window.open (address,'Ver_articulo', config=center); 

这篇关于window.open不在IE中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆