Javascript Window.open() Function Opens Link Without Popup Blocker
Javascript window.open() function opens link without popup blocker, I want to open some links from javascript window.open() function but it get blocked on firefox, chrome, safari.
Solution 1:
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!
Solution 2:
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
).
Solution 3:
You should launch you function from user event. i.e: onclick or href:
<ahref="javascript:window.open('http://google.com');return false;"> open 2 </a>
Post a Comment for "Javascript Window.open() Function Opens Link Without Popup Blocker"