How can I open a link in a new window?

后端 未结 10 1092
不知归路
不知归路 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:55

    you will need to use window.open(url);

    references:
    http://www.htmlcodetutorial.com/linking/linking_famsupp_120.html
    http://www.w3schools.com/jsref/met_win_open.asp

提交回复
热议问题