Wednesday November 19, 2008
You delay processing in JavaScript by triggering it after a specified time.
Not all of the events your page handles need to be triggered by your visitors actions. You can set up your own event triggers to run whatever processing you want after a specified time delay.
Timed Events
Tuesday November 18, 2008
Some people think using noscript makes a page more accessible, the reverse is true.
Anonymous responses that I received regarding prior articles on getting rid of the noscript tag demonstrate that some people mistakenly believe that the noscript tag can make your page more accessible. In fact getting rid of the noscript tag not only doesn't reduce accessibility, it also makes your HTML more semantically correct, your JavaScript can be less obtrusive, and the entire code will be easier to maintain. So as to clearly demonstrate how to go about improving your page in all these ways by getting rid of the noscript tag, I have a here a very simple example where we just want to display one of two different paragraphs in the page depending on whether JavaScript is enabled or not. I show three different versions, the first uses obtrusive JavaScript and the noscript tag. The second is longer in order to make the JavaScript unobtrusive but keeps the noscript tag. The thirs is unobtrusive, doesn't use noscript and is far shorter than either of the other two. As a second example I show how not using the noscript tag is even more flexible by showing an example where one of two paragraphs is displayed depending on whether or not the browser supports Ajax.
Getting Rid of Noscript
Monday November 17, 2008
A lot of people seem concerned about screen resolution when it comes to planning their page layout.
The browser viewport is where your web page displays and that is not the same thing as your visitor's screen. Even where your visitor has their browser open to fill the screen you still need to deduct for any fixed toolbars on the desktop and the browser chrome itself. Where screen resolution is somewhat relevant is where you are attempting to open a new window (assuming your visitor let's you). There the most useful sizes to know are those of the screen less any fixed toolbars giving you the space available in which to display the browser window. The BOM can provide us with this information.
The Screen
Sunday November 16, 2008
JavaScript Regular Expressions can test any character at all.
The twelfth tutorial on Regular Expressions shows you how to include any character at all in your JavaScript Regular Expression by specifying its ASCII or Unicode value.
ASCII and Unicode