| The Useful, the Usable and the Unbelieveable in Design for the Web | |
In This Issue...
Be Your Own SEO Expert with Web CEO
Time-limited. The Free Edition now comes with free training & certification. Download Web CEO and get access to Training and Certification
Introduction
JavaScript. Only two years ago it was still much-maligned -- today it plays pivotal roles in most of the Web's buzz technologies (Web 2.0, Ajax, Ruby and Prototype) and is arguably the single most important technology on the Web -- a great problem solver for the frontend designer and critical conduit for the backend code monkey.
Both its authors are well-known JavaScript freaks. James 'Brothercake' Edwards blogs on DOM scripting while maintaining the sublime Ultimate Dropdown Menu. He also knows more about the DOM than any one man rightly should. Cameron 'The Man In Blue' Adams is one of those guys who's so darn clever it borders on irritating. At last year's Web Essentials conference, he wrote and demonstrated a clone of the Mac OSX interface built from entirely from JavaScript -- just to show he could. Hmmm... Regardless, these guys really know their stuff and have spent nine months pouring it all into 588 pages of JavaScript manna from heaven. Like our other anthology books, it's an easy Q-&-A format -- just ask a question, thumb the table of contents, and get an answer. In short, if you've ever needed JavaScript (you're here, so you probably have) then grab the sample chapters and judge for yourself. Download the four Sample Chapters here. The other big event of the last few weeks here has been the debut of our first video tutorial. Kevin has put together a 10-minute Photoshop tutorial that takes you through the creation of a nifty starburst effect. We put this initial video together mainly to test whether it would be popular. At last count, we had almost 250 positive comments, so things are looking good for more in the future. We hope you enjoy this one.
Alex Walker
New Windows and Usability: the Theory of 'REL-ativity'New windows, popups and JavaScript -- are any words more likely to reduce an accessibility and usability expert to a foaming, spitting mass? Probably not. So, what's the big deal? Why do they get so upset? I thought we might take a look at a real live example site -- FancyaPint.com -- and see how 'good sites turn bad'.
To be fair, launching a new window for these 'destination pages' does have a couple of advantages -- chiefly in letting the user focus solely on one task (reading the review content, in this case) without the clutter of search controls and other site-wide navigation. It can also allow users to lay 3 or 4 reviews side by side for direct comparison. However, on the negative side it:
Ok, so that may not be 100% best practice, but it's not indefensible. Now let's look at the real problem -- the code that powers it all. Masks and helmets please! <a xmlns:metis="http://www.resear.../core"
Yes, that is a single ' ... continued after the ad ...
ProWorkflow - The Business/Project Dashboard for Web Design Firms and Freelancers!
ProWorkflow is customisable and expandable to suit your business and is available in two flavours: subscription account or permanent license to run on your own server. Click here to view our Free Online Demo or start your 14 Day Trial.
Let's run through just some of the problems inherent in the above code in the limited space we have available:
Still, we all have bosses and clients that at times require us to use popups for certain tasks, and to open external links in new windows. So, taking into account that ' target="_blank"' isn't valid in
XHTML strict, what might perfect HTML links look like?Let's try this as a starting point ... Popup Links
External Links (in a new window)
Now that's a little more svelte for summer! Our HREFs are now real links pointing to real pages, rather than null links ('#'), so we can guarantee 100% that any device from the first Netscape beta to IE7 will be able to understand and follow your link every time. The second attribute in our links may be less familiar.
'
As you can see, we're using values of
' The script we're going to use blends elements of two separate scripts into one tidy whole, and throws in some icons to make it look peachy. I'm just going run through an outline of how the script works, rather than providing a line-by-line breakdown here in the newsletter. However, it's well commented if you're into the nitty-gritty. Otherwise, if you're just interested in what it does, feel free to jump down to the example below. You probably won't need a deep knowledge of JavaScript to use this script in your development. What does it do? To summarize it, the script:
That should be all you need. For ease of studying, I've left the JavaScript and the CSS in the head of the example, but in practice you would always pop it into separate linked files. Is this Method Absolutely Bulletproof? Not quite, unfortunately. The W3C accessibility guidelines say 'thou shalt not change the current window without informing the user'.
As Bruce
Lawson and Gez Lemon figured out late last year, the
' Anyway, I've got some ideas on how we might remedy the situation -- I'll save them for the blog. For now, there's a good chance you'll find this method easier to use, easier to maintain, and more accessible than your current popup code. Take it for a spin and let me know.
That's all for this issue -- thanks for reading! I'll see you in a few weeks.
Alex Walker
Help Your Friends OutPeople you care about can benefit from the wealth of information on new and maturing technologies available on the Internet. Help them learn how to do it by forwarding them this issue of the SitePoint Design View! |
Download free chapters from every SitePoint Book!
The JavaScript Anthology: 101 Essential Tips, Tricks
& Hacks
Script Smarter: Quality JavaScript from Scratch
If you've avoided JavaScript, or only knew it in its previous "toy language" incarnations, now's the time to step up and get to know the newer, smarter JavaScript. This hands-on tour will get you started with JavaScript before illuminating the ways in which the DOM can be utilised via JavaScript, the practicalities of pop-up windows, and how JavaScript can work within a web page to produce slick DHTML effects.
Painless JavaScript Using Prototype
Is the sheer weight of your JavaScript code keeping you up nights? Sick of typing document.getElementById over and over (and over)? The Prototype library guarantees to relieve your script-induced stress. Let Dan take you on a whirlwind tour of this incredibly useful (but sparsely documented) collection of enhancements to the built-in JavaScript features of current browsers.
6 Killer Tips for More Web Design Clients
The new year is the perfect time to sow the seeds of business growth. First step: attract new clients. In this grassroots guide, Brendon shares the tips that generate the most leads for his own business, and explains how they can help your burgeoning client list flourish this year.
DHTML & CSS Blog:
Web Tech Blog:
Design
Blog: |
|
Manage Your Subscription Here.
SitePoint Pty. Ltd. Thanks for reading! |
|
|
© SitePoint 1998-2006. All Rights Reserved.
|
|
Design, coding, community or marketing? Select the right newsletters right for your needs...