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, 2022 in Java-Script by Soham
• 9,710 points
3,094 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, 2022 by Aditya
• 7,680 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,840 points
6,209 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,840 points
9,571 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,840 points
25,822 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,840 points
3,322 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,840 points
18,624 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, 2022 in Java by Rahul
• 9,680 points
11,993 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, 2022 in JQuery by rajatha
• 7,680 points

edited Jun 16, 2022 by Hemant 596 views
0 votes
0 answers

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

What is the difference between window.location.href and ...READ MORE

Sep 20, 2022 in Java by Nicholas
• 7,760 points
493 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
729 views
0 votes
1 answer

jQuery checkbox change and click event

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

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