window.open() not working in IE11

2019-02-17 13:23发布

I've searched many links for my query. But couldn't get the one I want. Am using in window.open(url, '_blank') in my script on click of button(am not using any html here, I want it to be on button click only). Its working in Chrome, IE8. I want to open a new tab in the same window in IE11. I don't want to do any settings in Internet Options of IE. Because the script has to work in every system, if I go with manual settings the script won't run in all the systems where ever I test. Is there any bug with IE11 ?

2条回答
可以哭但决不认输i
2楼-- · 2019-02-17 13:39

Window.open() itself opens in new tab, Just remove "_blank". Use the below code.

window.open(url);
查看更多
神经病院院长
3楼-- · 2019-02-17 13:55

window.open syntax is like :

window.open(strUrl, strWindowName, [strWindowFeatures]) 

So the second parameter is windowname, not the target sepcification.

Please refer this link

查看更多
登录 后发表回答