It's a setting in chrome. You can't control how the browser interprets the target _blank.
It's a setting in chrome. You can't control how the browser interprets the target _blank.
"_blank" is not guaranteed to be a new tab or window. It's implemented differently per-browser.
You can, however, put anything into target. I usually just say "_tab", and every browser I know of just opens it in a new tab.
Be aware that it means it's a named target, so if you try to open 2 URLs, they will use the same tab.
try this
onclick="window.open('http://www.google.com', '_self');
well it is browser specific, i tested it on mozilla and is working fine, but on chrome it open in new browser window. You can suggest to chrome makers or call ajax synchronus.
use async:false will work.
NOTE: In IE, open new browser window is default behaviour. user need to set settings explicitly
It depends what HTML version you use and if you care about W3C validation. In HTML5 you can use target="_blank" but with previous XHTML versions you couldn't and you had to use JavaScript to achieve the same result and make your site W3C valid. I think that's the only reason why many people used this method.
Of course using Javascript makes that user has to have JavaScript enabled to open this link in new window (and using adblocks/ghostery and similar addons make block some JavaScript) so I think if you only can, you should use target="_blank"
Window.open requires Javascript and can be blocked by popup stoppers. However, it does have additional options (width, height, options, etc). On mobile browsers, many options will be ignored.
It is preferred to use _blank as it is native to HTML whenever possible.
As per Mozilla Developer docs first parameter of open() will be a url. If url is an empty string, then a new blank, empty window (URL about:blank) is created with the default toolbars of the main window. also URLs won't load immediately. When window.open() returns, the window always contains about:blank. The actual fetching of the URL is deferred and starts after the current script block finishes executing. The window creation and the loading of the referenced resource are done asynchronously.
It can not be removed but you can change the text "about: blank" to your current URL by putting space in first position or by giving specific path.
var win = window.open(
"http://www.domainname.ext/path.png",
"DescriptiveWindowName",
"width=420,height=230,resizable,scrollbars=yes,status=1"
);