Adding Alternate Information

If you give your visitors access to information through scripts, you may want to provide an alternate method of getting that data if your visitor uses a browserfor example, on a mobile phonethat can't run the scripts.

To add alternate information:


Type <noscript>.


Type the alternate information.


Type </noscript>.

Figure 19.13. The noscript tag helps you take care of visitors who use a really old browser or one with scripting turned off.


  • If a browser doesn't understand the script tag, what hope is there that it will understand noscript? Actually it won't. It will completely ignore it and treat its contents as regular textwhich, curiously, is exactly what you want. Only the browsers that understand script (and thus can run the script) will understand noscript as well. And as long as they've got JavaScript on, they'll ignore the contents of the noscript tagwhich is also what you want. Clever, indeed.

  • Current browsers (and some older ones) allow your visitors to disable JavaScript. The noscript tag is perfect for telling those visitors what they're missing (Figure 19.14).

    Figure 19.14. If your visitor has JavaScript off, the noscript element will show a message informing them of what they're missing.

  • Mobile devices don't always support JavaScript (though this will probably change in years to come).

    Figure 19.15. If JavaScript is on, the contents of the noscript element will be hidden.

  • The noscript tag will not help if the browser doesn't support the scripting language or if there is a problem with the script.

HTML, XHTML, & CSS(c) Visual QuickStart Guide
HTML, XHTML, and CSS, Sixth Edition
ISBN: 0321430840
EAN: 2147483647
Year: 2004
Pages: 340

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: