0 votes
1 view
in Web Technology by (47.8k points)

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.

1 Answer

0 votes
by (107k points)

To open a URL in a new tab using JavaScript you can use the following method:-

function openInNewTab(url) { 

var win = window.open(url, '_blank');

win.focus();

}

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Aug 10, 2019 in Web Technology by Sammy (47.8k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...