I want to open a new tab using jquery. The code should be pretty simple, nevertheless the following code is not working hence it opens a new window
window.open('url', '_blank');
How do I open a new tab instead of a new window?
I want to open a new tab using jquery. The code should be pretty simple, nevertheless the following code is not working hence it opens a new window
window.open('url', '_blank');
How do I open a new tab instead of a new window?
It's not possible for you as the developer to determine.
Browsers have a setting that decides what to do when this happens, so the end user is the one who decides how the new window/tab will open.
The closest to "controlling" this, that I've seen, is when I pass a size in the third parameter of window.open
, it "forces" a new window (at least it has in the past). Of course, this most likely isn't consistent across browsers. And that is the opposite of what you're looking for.
It also doesn't help when there are browsers out there without the feature of tabs.