@Mr_MooAug 27.2007 — #There is no code that can specifically open a link in a new tab. Opening links in tabs or as new windows is a user option and cannot be controlled from JavaScript.
@firblazerauthorAug 27.2007 — #There is no code that can specifically open a link in a new tab. Opening links in tabs or as new windows is a user option and cannot be controlled from JavaScript.[/QUOTE]
I thought there is a code to open a link in a new window:
[CODE]<A HREF="javascript:popUp('location')">Open the Popup Window</A>[/CODE]
I thought maybe there is something similar to open a link in a new tab?
@Mr_MooAug 29.2007 — #I'm afraid target won't make windows open in a new tab either. Not by default, anyhow.
By default in IE7 the options are as follows:
[ATTACH]9531[/ATTACH]
Now, in the second group, if you switch to Let IE decide or Always open in a new tab, it will work. However, that is not the default. As far as I can remember the same is true for FF (I can't really test it because my FF is so customized it's barely recognizable anymore). In Opera it appears to work out of the box. There is an option to show windows instead of tabs, but it's not default.
All this to say, that ultimately it's a user setting. It's not default in IE and FF, and there's no way to force the opening of a new window in a tab from script.
@felgallAug 29.2007 — #The browser owner can decide whether to have all new pages open in the same window, a new tab, or a new window. They can also make separate decisions for links to separate sites and links within the same site. If they configure their browser to work their way then any target= attributes and window.open calls will open the way they want regardless of what you intended.
target= is deprecated because it is a behaviour and not content and so should be handled by JavaScript and not HTML.
window.open() will open in a new window if it isn't blocked by a popup blocker and the browser owner hasn't configured their browser to have it open in a new tab or the same tab instead.