Strict Standards: Non-static method module_diggbutton::init() should not be called statically in /home/bigtlittled/dbloomfield.org/blog/wp-content/plugins/gregarious/functions.php(161) : eval()'d code on line 1

Strict Standards: Non-static method module_sharethis::init() should not be called statically in /home/bigtlittled/dbloomfield.org/blog/wp-content/plugins/gregarious/functions.php(161) : eval()'d code on line 1

Strict Standards: Non-static method module_redditbutton::init() should not be called statically in /home/bigtlittled/dbloomfield.org/blog/wp-content/plugins/gregarious/functions.php(161) : eval()'d code on line 1

Strict Standards: Non-static method module_postbadge::init() should not be called statically in /home/bigtlittled/dbloomfield.org/blog/wp-content/plugins/gregarious/functions.php(161) : eval()'d code on line 1

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGenerator::Enable() should not be called statically in /home/bigtlittled/dbloomfield.org/blog/wp-includes/plugin.php on line 311
accessibility — David Bloomfield’s Blog
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bigtlittled/dbloomfield.org/blog/wp-includes/kses.php on line 947

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bigtlittled/dbloomfield.org/blog/wp-includes/kses.php on line 948

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bigtlittled/dbloomfield.org/blog/wp-includes/kses.php on line 947

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bigtlittled/dbloomfield.org/blog/wp-includes/kses.php on line 948

Entries Tagged 'accessibility' ↓

Accessible ways to open a new browser window

Personally, I’m not keen on forcing a new browser window to open on the user. It takes away user control. Users should have the right to decide if they open a new window or not.

Most people now, especially with the rising popularity of Firefox and Internet Explorer 7, are familiar with tabbed browsing. If they want a new window or tab they’ll right click and open a new window or tab.

So what’s the problem?

Well, sometimes it is necessary to force the opening of a new window. For example, a third party application that “integrates” with your website may need a new window to be opened in order to preserve the user experience and aesthetic appeal.

This is a scenario local government websites and probably many legacy website face. A third party application is brought in and rolled out that looks nothing like the main website except the company logo that is placed in the header.

That’s the fully integrated web application as promised by your supplier.

This is a case where you would want to force a new window to open.

How to open a new window

Be nice, warn users that a new window is going to open.

It is only polite.

Using text such as “Opens in a new window” in the link text tells the user exactly what is going to happen.

Design

This does look very good though, does it?

Well, you could put “Opens in a new window” in the title attribute. However, this will not help visual users who use the keyboard to “tab” around the website. No modern browser displays the text in the title attribute as a user tabs through web page content with a keyboard.

HTML 4 doctype

If you are still using a HTML 4 doctype you could use the target attribute of the anchor tag.

target=”_blank”

Bish, bash, bosh and you’re done. No JavaScript needed. Perfectly valid for your doctype.

XHTML doctype

Most people now, I like to think, are using an XHTML doctype. The target attribute is no longer an option if you want your page to validate to W3C standards.

Using JavaScript to open a new browser window

There are several blog posts and forum discussions about using non-obtrusive JavaScript to open a new browser window.

These can be found at:

Reading through the various posts and discussions I favour Roger Johanssons method.

He shares a similar view about opening new browser windows.

“Opening new windows should almost always be avoided. There are very few exceptions to that rule. However, sometimes it is beyond your control as a Web developer to enforce that. You can normally choose which DOCTYPE to use though. I prefer using a strict DOCTYPE, which does not allow the target attribute. And that is why I created this script. It can also be argued that opening new windows is behaviour, and as such should be moved to the behaviour layer (JavaScript) anyway.” - Roger Johansson

It’s a piece of non-obtrusive JavaScript that kicks in when you specify

rel=”external”

on the anchor tag.

It adds text “opens in a new window” to the link text.

Then, not surprisingly, it opens the link in a new window.

What if JavaScript is not enabled?

If JavaScript is not enabled it just displays the standard link text and opens normally without opening the new window.

You might think that

target=”_blank”

is better as it doesn’t need JavaScript to work but it now deprecated, gone, left the building, dead.

In the words of Andy Clarke, “No one dies”.

Again, here is the link you’ll need

Opening new windows with JavaScript, version 1.2

Colour Contrast Check

Snooks Colour Contrast Check tool is probably one of the most simpliest and effective way to check whether your background and foreground colour are significantly different so colour blind people can read your text.
Snook has recently, well in january, upgraded this it to have a nicer look to it with some funky html sliders.
Go have a look and book mark it.