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.

 

Leave a comment

Your email address will not be published.

%d bloggers like this: