Nothing an author can do can choose to open in a new tab instead of a new window. It is a user preference.
CSS3 proposed target-new, but the specification was abandoned.
The reverse is not true; by specifying dimensions for the window in the third argument of window.open
, you can trigger a new window when the preference is for tabs.
open(url, '_blank'); the '_blank' isn't necessary, for window.open(), the second parameter is strWindowName, for: A string name for the new window. The name can ...
The open() method opens a new browser window, or a new tab, depending on your browser settings and the parameter values. See Also: The close() method. Syntax.
To open a URL in a new tab/window in JavaScript, we use the window.open(URL, target) method. To open a new tab, however, we must use _blank as the second ...