Go Back   HTMLCenter Web Development Forums > Web Design and Development > Usability and Accessability

Don't open new windows (revised tutorial)

View Poll Results: How would you grade this tutorial?
Excellent 1 50.00%
Very good 1 50.00%
Good 0 0%
Fair 0 0%
Misleading 0 0%
Voters: 2. You may not vote on this poll

Closed Thread
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-07-2004, 08:49 PM
Webnauts's Avatar
Moderator
 
Join Date: Jul 2003
Location: Augsburg, Germany
Posts: 222
Send a message via AIM to Webnauts Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Don't open new windows (revised tutorial)

Actually you should not force links to open in a new window or popups (such as with the "target" attribute or with JavaScript).

As you might know, JavaScript is not supported by all browsers and some users disable it. When JavaScript is used, it should not be relied upon.
In such cases you will disable your visitor to access your content.

You should avoid as far as possible implementing JavaScript, to avoid running risks on complications on the end users machines, or while goverment and other employees are required to disable this feature, for security or other reasons. Also there is a number of users who are very concerned about security issues and disable this feature too.

The issue here is not only concerning users disabling JavaScript in their browsers. How many do so? 8%?

What about cell phone users? How about sight impaired users? For the ones who when changing the current window or popping up new windows can be very disoriented, while they cannot see that this has happened. And how much percent are they?

The usability Jakob Nielsen say's about this:

Quote:
JavaScript in Links.

Links are the Web's basic building blocks, and users' ability to understand them and to use various browser features correctly is key to enhancing their online skills.

Links that don't behave as expected undermine users' understanding of their own system. A link should be a simple hypertext reference that replaces the current page with new content. Users hate unwarranted pop-up windows. When they want the destination to appear in a new page, they can use their browser's "open in new window" command -- assuming, of course, that the link is not a piece of code that interferes with the browser’s standard behavior.

Users deserve to control their own destiny. Computers that behave consistently empower people by letting them use their own tools and wield them accurately.
Source: http://www.useit.com/alertbox/20021223.html


Another fact is, that if you markup with XHTML Strict, the "target=_blank" is not supported!

If you absolutely must open a link in a new window, explicitly warn the user with a clear indication that the page will open in a different window. Provide a title attribute on the anchor tag with a description indicating that the link opens a new window; for example:

Code:
<a href="http://www.eypd2003.org" target="_blank" title="Link opens in new window.">European Year of People with Disabilities 2003 (new window)</a>
If you do so, keep in mind that targeting a link to open in a new window violates the W3C/WAI Web Content Accessibility Guidelines [1], and (if you're in the United States or other country with comparable anti-discrimination legislation) is quite possibly illegal under federal civil rights law.

Radical changes of focus in a GUI environment are extremely disorienting to blind users who are navigating by screen reader, and thus can be considered discrimination against the visually impaired.

- Opening a link in a new window also breaks the back' button on the browser, preventing back-tracking in navigation;

- It also bypasses the tabbed navigation in Galeon and Mozilla, irritating users of that feature;

- If your user wants to open the link in a new window, he or she can do so quite easily with most browsers; there is no need to force the issue;

- It's about leaving the user the freedom to navigate in the way that works best for him or her;

- It's not unusual for a designer never to have thought about such issues; that's why we have the WCAG to point out to us things we might otherwise overlook. Or?


After all do you want to build an accessible pop-up window? Then add the code below within the head tags of your HTML document. (Script source: http://www.accessify.com)

Code:
<script type="text/javascript"> 
var newWindow = null; 

function closeWin(){ 
if (newWindow != null){ 
if(!newWindow.closed) 
newWindow.close(); 
} 
} 

function popUpWin(url, type, strWidth, strHeight){ 

closeWin(); 

if (type == "fullScreen"){ 

strWidth = screen.availWidth - 10; 
strHeight = screen.availHeight - 160; 
} 

var tools=""; 
if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0"; 
if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0"; 
newWindow = window.open(url, 'newWin', tools); 
newWindow.focus(); 
} 
</script>
Then add your link in the body of your document as below:

Code:
<a href="http://www.w3.org/WAI/" onclick="popUpWin(this.href,'standard',640,480);return false;" onkeypress="popUpWin(this.href,'standard',640,480);return false;" title="Link open's in a new window">Web Accessibility Initiative (WAI)</a>
Example see here: http://www.webnauts.net/popup.html - Test it disabling JavaScript to see how it works!


Further reading:

Avoid forcing links to open in a new window
Not opening new windows: http://diveintoaccessibility.org/day...w_windows.html
Use interim solutions: http://www.w3.org/TR/WCAG10/#gl-interim-accessibility <http://www.w3.org/TR/WCAG10/
Opening a link in a new window: http://lists.w3.org/Archives/Public/...2Apr/0100.html

---
Notice: This article is written by John S. Britsios, founder and owner of the Webnauts Net and may be reproduced in a website, e-zine, CD-ROM, book, magazine, etc. so long as his name is included in full, including a link back to this website.
__________________
Optimizing for Search Engines, with Humans in Mind.
SEO Workers Professional Search Engine Optimization Consulting Company | SEO Analysis Tool
SEO Articles & Tutorials

Last edited by Webnauts; 03-17-2005 at 08:43 PM.

  #2 (permalink)  
Old 08-29-2004, 06:35 AM
tthurgo's Avatar
Moderator
 
Join Date: Jan 2002
Location: Lebanon, PA
Posts: 357
So is this a bug? I mean, you are using JavaScript and it even works with JavaScript turned off?

I do favour your title solution (telling people that it opens a new window).

Tom
__________________
Tom Thurgo
my future is coming on
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 02:40 AM.

 
Bitrix
Clicky Web Analytics
Maxtango
CloudContacts


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter