Posted By

mountainash on 05/03/07


Tagged

window popup blank open new target


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

basicmagic
jachin


Inline new window javascript (pop-up)


 / Published in: JavaScript
 

This code is very streamlined and a good in-line replacement for XHTML validation (target attribute is depreciated). When you can use the DOM to find the links with external JS (see my rel method). Works well if JavaScript is not supported and still allows for user over-ride (ie. new window or new tab).

  1. <a href="page.html" onclick="return !window.open(this.href)">

Report this snippet  

You need to login to post a comment.