Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 to actually open the url in a new window though, how do I do this?(我需要这个在新窗口中实际打开网址,我该怎么做?)   ask by Chris translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
536 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can like:(你可以这样:)

window.open('url', 'window name', 'window settings') jQuery:(jQuery的:) $('a#link_id').click(function(){ window.open('url', 'window name', 'window settings'); return false; }); You could also set the target to _blank actually.(您也可以将target设置为_blank 。)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...