Javascript window.open()
function opens link without popup blocker, I want to open some links from javascript window.open()
function but it get blo
Just found the answer from a different thread, thought I shared this one with you guys, the ONLY way to bypass the popup blocker is through the onclick event, the problem I was having was that I had onmousedown instead, I just simply changed it to onclick, and boom! worked instantly!
You can't force it to open a new tab. The functionality is controlled by the browser entirely.
To avoid having your windows blocked, have the window open on any user event (like onclick
).
You should launch you function from user event. i.e: onclick or href:
<a href="javascript:window.open('http://google.com');return false;"> open 2 </a>