The purpose of "_blank" is not to open a new window

I have an image map with one of the following entries

<area shape="poly" tooltip="Canada" onmouseover="setAreaOver(this,'world_canvas','0,0,255','255,0,0','0.5',1,0,0);cvi_tip._show(event);" onmouseout="setAreaOut(this,'world_canvas',0,0);cvi_tip._hide(event);" onmousemove="getCoords(event,'map_of_world','map_of_world_6','world',32,371,800,400,1903,2876);cvi_tip._move(event);" href="http://someurl.com" target="_blank" id="map_of_world_6"> 

UPDATED

I am using Google Chrome and I removed the coords attribute from the fragment because it is too long.

When you click on an area, the main page goes to url instead of opening on a new page. Is it correct to use target=_blank ?

+4
source share
2 answers

Your syntax for the target attribute is correct, but the browser does not need it. They may interpret it as opening a destination in a new tab rather than a new window, or they may completely ignore the attribute. Browsers have settings for such problems. In addition, opening new windows can be prevented with browser plug-ins (usually designed to prevent annoying advertisements).

You can do it as an author. You might want to open a new window using JavaScript, cf. to the accepted answer to target = "_blank" doesn't work in firefox? , but browsers may be even more reluctant to allow pages to open new windows, rather than through target .

+7
source
 onclick="window.open(this.href,'_blank');return false;" 
-1
source

Source: https://habr.com/ru/post/1480873/


All Articles