Scripting and Browser Concerns

In some instances, people are using old browsers with no JavaScript support or poor support for the script element itself, or have JavaScript disabled. Working around these issues requires some additional markup.

NOTE

Most contemporary web designers do not use the workarounds here unless they absolutely know that they have to support older browsers. However, you might want to use them. At the very least, it's important that you see these techniques in action so you'll recognize them when viewing HTML from other sources.

Hiding Scripts from Older Browsers

If you're using embedded JavaScript, some older browsers attempt to display whatever is contained within the script element as body text.

To avoid this, ...

Get Spring Into HTML and CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.