Open Specific Document Types in New Window

Recently in one of my SharePoint 2010 projects, we needed to open pdf documents in new window by default. After some research I found Ben Ramey’s blog post on this subject. He shared a little JavaScript to open every document in a SharePoint document library in a new window. So I made a little customization to open only “pdf” documents in new window. In line 8, I’ve added [href*=’.pdf’] to filter pdf file extension. You can change this part to open specific file types in new window. For more detail about the script please visit Ben Ramey’s blog.


This post is also available in: Turkish

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.