The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

@Logic Ali: You should use a block-level element rather than a SPAN, since the snippet you posted isn't valid with a Strict DTD. In this case, <p>…</p> seems appropriate.

@TicTac: If you have to display a message like this, you should consider starting over. Progressive enhancement is a much better method: build the page so that it works without JavaScript first, then add JavaScript enhancements (unobtrusively).

That way, people with JavaScript disabled or unsupported (which may not be their own decision) will not notice anything wrong, while those with JavaScript enabled get a better experience.

There is no longer any need for the <noscript> tag. The HTML contains what you want people without JavaScript to see and simply hide anything that is not needed when JavaScript is available using JavaScript.

You don't need one. Having javascript off shouldn't cause an "error", it should just provide a less colourful, though not less functional, experience. However, if you really insist on it (bad) and your page cannot possibly function without javascript (bad) and you want to inform the user of this (bad), you create your paragraph with the apologetic text in it and then hide it with javascript. That way anyone with javacscript off will see it and for those with javascript it will be hidden. However, I'd like to point out that this is a bad (bad) idea. Like the above posters said, progressive enhancement is the way forward.

It can be to perform client-side form validation, for performance reasons. You mustn't rely on this, but have the main validation server-side, but doing it client-side if supported enhances the usability.

It can be to use an Ajax solution to populate chained select boxes, like choosing country/region/city. It would still work without JavaScript, but it would require a round-trip to the server for each choice. Using JavaScript it can be faster and improve usability.

It can be to provide toggle features, e.g., hiding lengthy code examples to reduce scrolling for users with JavaScript enabled.

The only time I use JavaScript in such a way that the page doesn't work without it, is on our intranet where I know that it's supported and enabled.