A live test link to javascript-target.pdf.
A live test link to example.com. Note: If you want to use the script to open links to HTML documents in new windows I suggest using a different class name than "non-html".
This is a demo of the script explained in Opening new windows with JavaScript, version 1.1.