jQuery: go to URL with target=“_blank”

后端 未结 7 1953
悲哀的现实
悲哀的现实 2020-12-04 15:12

I am using this bit of jQuery code to get href of the link:

var url = $(this).attr(\'href\');

-- and this bit of code to go to that href:

7条回答
  •  遥遥无期
    2020-12-04 15:46

    You need to open a new window:

    window.open(url);
    

    https://developer.mozilla.org/en-US/docs/DOM/window.open

提交回复
热议问题