I'm trying to open a URL in a new tab, as opposed to a popup window.
I've seen related questions where the responses would look something like:
window.open(url,'_blank');
window.open(url);
But none of them worked for me, the browser still tried to open a popup window.
Best Answer
This is a trick,
In most cases, this should happen directly in the
onclick
handler for the link to prevent pop-up blockers, and the default "new window" behavior. You could do it this way, or by adding an event listener to yourDOM
object.http://www.tutsplanet.com/open-url-new-tab-using-javascript/