window.open() not working in IE11

2019-02-17 13:27发布

问题:

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 ?

回答1:

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

window.open(url);


回答2:

window.open syntax is like :

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

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

Please refer this link