Open a URL in a new tab and not a new window

0 votes

I was trying to open a URL in a new tab, as opposed to a popup window. I have also seen some 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.

Feb 23 in Java-Script by Soham
• 8,730 points
137 views

1 answer to this question.

0 votes
Nothing an author can do can choose to open in a new tab instead of a new window as it is a user preference. Please keep in mind that the default user preference in most browsers is for new tabs, so a trivial test on a browser where that preference hasn't been changed will not demonstrate this. CSS3 proposed target-new, but the specification was abandoned. The reverse is not true as by specifying certain window features for the window in the third argument of window.open(), you can trigger a new window when the preference is for tabs.
answered Feb 23 by Aditya
• 7,280 points

Related Questions In Java-Script

0 votes
1 answer

How to open a URL in a new Tab using JavaScript or jQuery?

Hello @kartik, Use window.open(): var win = window.open('http://edureka.co/', '_blank'); if (win) ...READ MORE

answered Aug 25, 2020 in Java-Script by Niroj
• 82,720 points
3,049 views
0 votes
1 answer

How to open the newly created image in a new tab?

Hello @kartik, You can try something like: success: function ...READ MORE

answered Jun 19, 2020 in Java-Script by Niroj
• 82,720 points
4,899 views
+1 vote
1 answer

How to delete a localStorage item when the browser window/tab is closed?

Hii @kartik, You can make use of the beforeunload event ...READ MORE

answered Jun 11, 2020 in Java-Script by Niroj
• 82,720 points
8,559 views
0 votes
1 answer

How to check if a specific key is present in a hash or not?

Hello @kartik, While Hash#has_key? gets the job done, as it has ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj
• 82,720 points
1,704 views
+1 vote
1 answer

How can we send message multiple time to a specific person or group in whatsapp using loop?

Hii @kartik,  This is simple task to send single ...READ MORE

answered Feb 28, 2020 in Java-Script by Niroj
• 82,720 points
5,573 views
0 votes
1 answer

window.location.href and window.open () methods in JavaScript

To answer your question, first of all, ...READ MORE

answered Feb 9 in Java by Rahul
• 8,980 points
1,319 views
0 votes
1 answer

How to build simple tabs with jQuery?

Create Tabs Using jQuery and CSS Create Tab: ...READ MORE

answered Jun 16 in JQuery by rajatha
• 5,040 points

edited Jun 16 by Hemant 16 views
0 votes
1 answer

Presenting docket dtates inside html page by javascript

Use the Docker Engine Api:Docker Engine API ...READ MORE

answered Jun 20, 2018 in Docker by DareDev
• 6,890 points
212 views
0 votes
1 answer

Migrating proxy npm repo in nexus 3

I don't think you can achieve this ...READ MORE

answered Jun 22, 2018 in DevOps Tools by DareDev
• 6,890 points
794 views
0 votes
1 answer

jQuery checkbox change and click event

Have shared an approach which will add ...READ MORE

answered Feb 23 in Java-Script by Aditya
• 7,280 points
1,234 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP