Target “_blank” not opening new window

前端 未结 2 1766
情歌与酒
情歌与酒 2021-01-13 03:56

I have an image map with one of the following entry



        
相关标签:
2条回答
  • 2021-01-13 04:31

    Your syntax for the target attribute is correct, but browsers need not honor it. They may interpret it as opening the destination in a new tab rather than new window, or they may completely ignore the attribute. Browsers have settings for such issues. Moreover, opening of new windows may be prevented by browser plugins (typically designed to prevent annoying advertisements).

    There’s little you can do about this as an author. You might consider opening a new window with JavaScript instead, cf. to the accepted answer to target="_blank" is not working in firefox?, but browsers may be even more reluctant to let pages open new windows that way than via target.

    0 讨论(0)
  • 2021-01-13 04:31
    onclick="window.open(this.href,'_blank');return false;"
    
    0 讨论(0)
提交回复
热议问题