window.open在IE下ajax中的兼容性

问题:在ajax中window.open在IE下会弹出浏览器阻止窗口的问题,进而不再执行window.open打开新tab页的方法
解决方法
在ajax方法之前加上:

windowOpenHandler = window.open("/loading-tips.html"); // /loading-tips.html 为提示加载页面

在ajax内部之前window.open的位置用下列方法替换:

windowOpenHandler.location.href = "http://www.realURl";

猜你喜欢

转载自blog.csdn.net/xujiezi/article/details/51911673