When designing web sites should document files such as PDF, DOC, XLS, should the documents open in a new window/tab or in the current tab?
-
possible duplicate of Opening website external links in new window -- published usability tests– Vitaly MijiritskyApr 16, 2012 at 21:53
-
1Vitaly provides a good link that should give you some additional information. However as this question is specifically around documents opening in new tabs and not just any pages then you should get some more specific answers to that question here. If any answers are more explicitly around web pages opening in new windows then that link above should be used otherwise we risk duplicating answers across two questions. Hopefully these questions can be kept separate.– JonW ♦Apr 17, 2012 at 12:15
5 Answers
Jakob Nielsen has an (old) article that deals with your issue: Open New Windows for PDF and other Non-Web Documents
How about having 2 actions for documents: Download and View? Here's some examples:
Cloud App
Gmail
-
But note that 'view in your browser' is not a guarantee. A word file, for instance, won't open in everyone's browser. It's entirely dependent on variables out of your control. (note that google handles it via google docs, which is a nice solution...if you've happened to write a MS Office compatible online office suite)– DA01Apr 17, 2012 at 22:24
You never have to use target="_blank"
, if users wants to open it on a separate window can choose to do that, but you should not force someone to open a new window.
I would suggest that you open your documents in a new window. Mainly because some documents like pdfs could possibly break browsers navigation if a user clicks a link inside. By opening documents in a new windows you can prevent this. In my experience its more frustrating to completely lose my prior navigation that having a document open in a new window/tab.
Also note, for accessibility reasons you should let the user know when a page/document is going to open in a new window.
-
The problem is you can't reliably do that. It's up to the browser/user/OS/device as to what happens with non-web files.– DA01Apr 17, 2012 at 22:23
You have no control* over document formats that the browser doesn't natively support. They may open in the browser with a plugin. Or they may download. Or they may open in an external application of the browser and/or end-user's preferences.
As such, you should not open a new window, as you have no control over it.
Instead, let the end-user know what kind of file they are about to click on, and then they can handle the rest to their own personal preferences.
- the one exception is that you can force the save dialog to appear if you stream the file from the server. That's sometimes a useful thing to do.
I've always liked providing the document type and size in the link and letting the user's native applications open the file.
e.g., [a href="report.pdf"]Annual Report (PDF, 233Kb)[/a]
This lets the user know that it is not a web page (and doesn't act like one), and also gives them information on the size so that if they think it's too big or will take too long to download, they can skip it.