How can I open a link in a new window?

后端 未结 10 1096
不知归路
不知归路 2020-11-30 19:21

I have a click handler for a specific link, inside that I want to do something similar to the following:

window.location = url

I need this

10条回答
  •  时光取名叫无心
    2020-11-30 19:34

    Microsoft IE does not support a name as second argument.

    window.open('url', 'window name', 'window settings');
    

    Problem is window name. This will work:

    window.open('url', '', 'window settings')
    

    Microsoft only allows the following arguments, If using that argument at all:

    • _blank
    • _media
    • _parent
    • _search
    • _self
    • _top

    Check this Microsoft site

提交回复
热议问题