24.4. Using JavaScript to Customize Web Pages

Because JavaScript can determine several characteristics of the current browser and document, you can use it to build different Web pages in different circumstances. For instance, you might want to use certain Microsoft-specific features on Internet Explorer and Netscape-specific features on Netscape Navigator. Or omit certain background information if users came to your page from another one of your pages, as opposed to an outside page. Or use smaller images if the user has a small screen. Or use embedded objects only if the browser has a plug-in that supports them. Integration with Java (Section 24.9) will allow additional applications such as printing only a “Sorry, no Web page for you, buddy!” ...

Get Core Web Programming, Second Edition 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.