开发者

How do I open a new browser tab?

开发者 https://www.devze.com 2022-12-24 03:38 出处:网络
I\'m working on this project and I have to open a new browser tab. Actually, I have to open a target=\"_blank\" link without the link. I know is not right to interfere with the user preferences, but h

I'm working on this project and I have to open a new browser tab. Actually, I have to open a target="_blank" link without the link. I know is not right to interfere with the user preferences, but hey, this is the project requirements.

So, long story short, i have to replicate the target="_blank" behavior only with javascri开发者_高级运维pt.

Is this even possible? Thanks!


window.open('http://www.example.com','_blank')


var w = window.open();
$(w.document.body).html("Whatever or any ajax response ...")
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号