Change style sheet. Page last changed today See section 9D of the book.
Opera 8 and lower don't support the styleSheets[] array. On this page I try to change the background colour of a PRE, not by accessing the element directly but by changing the entire style sheet of the page. Unfortunately browser incompatibilities are so severe that this script isn't really usable in practice yet. Please note the difference between traditional DHTML and this example script. See also the W3C DOM - CSS compatibility table. Definitions A page contains one or more style sheets which in turn contain one or more rules which contain the actual style declarations. The purpose of our test script will be to change the white background colour of the pre.test to its normal value #EEF0F5.
All linked and embedded style sheets are available through the document.styleSheets array. quirksmode.css, the general style sheet for the entire site, is document.styleSheets[0]. CssRules is supported by Explorer Mac, Mozilla, Safari, and Opera. Example. Preview Your Links with Unobtrusive JavaScript. Introduction You know that feeling at the grocery store express lane when you find out that the person in front of you actually has 74 items, a book of coupons, a checkbook and arthritis? That’s the feeling I get after clicking on an innocent looking link that goes to a PDF unexpectedly. Inspired by the TargetAlert Firefox extension that “provides visual cues for the destinations of hyperlinks” and Christian Heilmann’s Image previews with DOM JavaScript , we wrote a simple set of unobtrusive JavaScript functions to find links on a page that go to amazon product pages, pdfs, word documents or whatever destination that might slow down the browsing process and adds an icon next to them to let you know what you might expect to find behind a link.
Just add the JavaScript include to your header and nobody leaves your site feeling violated. See it in Action The Files How it Works We start out by adding the onLoad event listener to call ‘linkPreview()’. And that’s it. Unobtrusive Flash Objects (UFO) v3.0. UFO is officially deprecated.
SWFObject 2.0 is UFO's successor and can be downloaded from Google Code. UFO is a DOM script that detects the Flash plug-in and embeds Flash objects (files with the .swf extension). It has its roots in the Web Standards community and is designed to support W3C standards compliant, accessible and search engine friendly web design. It also contains several features and best practice techniques that other scripts currently don't have. UFO is free, licensed under the CC-GNU LGPL and an Open Source Flash Project. Download UFO v3.22 JavaScript file and sample page or UFO v3.22 ZIP file (required if you enable the Macromedia express install feature). Features: 13 reasons why you should use UFO UFO enables you to create accessible and search engine friendly Flash content.
How to use STEP 1: Create an (X)HTML page with a placeholder element (any block element) for your Flash movie. <! STEP 2: Link the UFO script in the head of your (X)HTML page. <! Parameters Feedback.