Forum Moderators: open
I'm currently using target="_blank" on all the links that take the user to a pdf (used for a print-friendly version of a page) because the pdf can't contain links and I don't want to "orphan" the user.
Good or bad? Are we to the point where I can reasonably assume everyone can find the "back" button? Does a new window (or tab, depending on browser settings) just confuse / frustrate the user more? My site is about art photography, and tends to cater to a slightly older demographic (40-65 ish).
How about external links? I'd like to keep users on my site as much as possible, and I'm willing to bet most of them don't know about the right-click -> "new window" option. Is using it here just being greedy?
I'm thinking of moving to a strict doc-type, and I'm not really interested in using a JS workaround.
Thanks!
Getting rid of it sure would make going "strict" a whole lot easier.
Anyone know what the percentage of browsers still around WITHOUT pdf plugins is? How do they handle clicking on a pdf?
Another good one is "supplemental information" like small help files or supplemental content that would ordinarily clog up the topic with tangent data.
What's annoying is when the navigation is to an ordinary page but the author seems to think a new window "keeps them on the site" more. Examples: A TOS or anything that moves from the prime objective: sell, sell, sell.
In this case, it's always good to do:
<a href="mypdf.pdf" target="_blank">View</a> (PDF 15K, new window)
... So they have some indication of what to expect.
I'm thinking of moving to a strict doc-type, and I'm not really interested in using a JS workaround.
You can do JS in a strict doctype and it will validate. Just do it externally, attaching behaviors on load, and don't clog up the document with inline JS.
<head>
<script type="text/javascript" src="your.js"></script>
</head>
.....
window.onload=function() { attachBehaviors(); }
... where attachBehaviors attaches .... behaviors .... to document elements by classname or id.
In your document, these elements would of course have support for non-JS browsers. If present, the JS overrides natural behavior. Read up on "unobtrusive Javascript".
I prefer JS methods over "target="_blank" for one reason. Target="_blank" will always open a new window or tab exactly the same size as the original, covering up the original and is extremely confusing or disorienting, especially if the user clicks and looks away for a slurp of coffee.
With a Javascript method, you can control the size of the window so that's it's VERY obvious it's a new window and you can still see the parent behind it. As above, support for non-JS is mandatory (self-imposed.) This is an inline example, but in practice this would be externally loaded as mentioned:
<a href="mypdf.pdf" target="_blank" onClick="newWin('mypdf.pdf');>View</a> (PDF 15K, new window)
<script type="text/javascript">
function newWin(url) {
var day=new Date();
var id=day.getTime(); // Unique, assures new win. on every click
var win = open(url,id,600,500,'scrollbars,resizable');
}
</script>
If JS is disabled, it uses blank.
Even with JS - consider the user and always allow these to be resizable and with scrollbars.
Does anyone actually LIKE something opening in a new window?
I do. I use JS quite a bit to open new windows especially for documents that are typically not viewed as a web page such as pdfs.
I've done some extensive usability testing in this area. I've managed an online distance education program for years. The JS popups we have throughout the site have served the visitors very well and continue to do so. We make sure our popups are void of anything other than the material they are viewing. No toolbars, no address window, nothing but a fixed window size that is positioned based on their interaction with the system. We may have windows opening to the right, to the left, from the top, etc. It is all relative to what is on the page and where we'd like the user to see the window when invoked.
Also, that target="_blank" attribute is deprecated so there are usually challenges during validation of Strict DOCTYPEs.
In future, I might explore having a link to a page with a content div (frame? - don't wanna) containing the document to print, and a "print" button that only prints the div. Somehow. But that's later.
Thanks again.
coming in a bit late but here is my take.
As your pdfs are not used to be read but to be printed, you could serve the pdf as a choice to open/save(see here -http://www.stuvel.eu/pdfdownload ). We do this on all our sites.
Another idea would be to use the print stylesheet - see here [webmasterworld.com] and there [webmasterworld.com].
And finally if the print style is not an option and want to explore the js solution have a look here ( [webcredible.co.uk...] )
[edited by: encyclo at 3:14 pm (utc) on Nov. 3, 2008]
[edit reason] fixed link [/edit]
Anyway, I do not use target="_blank" at all. I do use popups for movies, pdf files etc. I also provide an option to turn off the feature. In addition, the site is completely usable with JS turned off except for some "pre-me" applications which I will be rewriting. Anything that is popped up is written like this. <a href="/path/fileame.html" onclick="popupfunction(this.href); return false">link here</a>.
For starters, target isn't in the XHTML spec, i don't know if that will affect you or not.
Second, my general rule of thumb is that i allow a target on links if it directs the user to an external site, or in your case opens a file.
From a userbility standpoint, if you do implement link that open in new windows ideally you want to put text next to that link that explains to the user that it will do just that, for example:
Click here to visit the BBC! (external site, opens in new window).
That would cover all your angles if implemented.
Also, i would like to direct your attention to an article posted by Jakob Neilson:http://www.useit.com/alertbox/20010610.html
New windows breaks the content flow, navigational structure, and leads to loss of confidence in the user. You can soften the blow with my previous suggestions, but as a rule of thumb the "breaking flow" is a biggy when it comes to accessibility to the general user.
I hate when I click a link and a PDF opens in the same window.
My rule of thumb has always been, I indicate the file type if the link is not to a webpage. But PDFs and external links always are target="_blank"
I do it that way because that is my preference when I surf. If I am on a site and it links to another site I almost always want it in a new tab. I am 34
I overused _blank in my less experienced days and still come across annoying little things as a result, such as the page that didn't have any navigation as my original, and forgotten, intention had been to display it as a stand alone item in a new window.