Open All Links to PDF files in a New Window

Browse My Free Website Guides

This finds all of the links pointing to PDF files and opens them in a new window. If you are using Chrome, you will need to enable popups for this to work.

$("a[href$='.pdf']").each(function () {
   window.open($(this).attr('href'),"_blank");
});

 


Related posts

Tags:

Want to Get Email Updates of New Posts? Join My Email Newsletter