A CG215 classmate (at SUNY/FIT in NYC) discovered a wonderful JavaScript source (http://www.gatescript.com). Among the great tutorials linked thereto was Ray Stott's http://www.crays.com/learn/ -- from which the above JavaScript window.document.write() method was abstracted.

We're using this "opener" page to satisfy some of the CG215 final project's requirements, which we would not know where else to use. And we are not applying CSS on this page just to keep things as simple as possible while we concentrate on checking browsers.

[new_location.htm flipped open an alert window that changed the location and disabled the back button in the new browser window. BAD! Bad script! We disabled it here.]

So we'll try two JavaScripts (placed in the BODY instead of the HEAD) to check plug-ins.

And, for good measure, let's throw in some "browser sniffers" covered in Chap.16 of Steve Callihan's Cascading Style Sheets (CSS) by Example. We've used an ".ahem {display:none} class" elsewhere that should only be seen by non-CSS-compliant browsers. CSS by Example points out that some browsers (such as Netscape Navigator 4), while supporting display:none, do not support the IFRAME element ... soooo, stick the invisible style rule inside IFRAME tags.

Callihan's CSS by Example book cautions to only use the "DOM Sniff Method" if advanced features employed on page "break" non-complaint browsers. Breaking a browser is especially true if page uses W3C's Document Object Model or ECMA Script (JavaScript), as well as certain CSS features (such as absolute or relative positioning) that can negatively impact display.

This JavaScript would redirect viewers/users to an upgrade page -- whether or not they want to go there. It is an AWFUL, USER-ABUSIVE script that SLAM DUNKS you on www.webstandards.org/upgrade site (which uses a table-layout format) with no BACK or other way out and no contact info: It was too offensive. We DISABLED it in favor of a "confirm" window leaving choice to user.

< < < Back Up to Top of this page.                      Or, click forward to Foreline's Gateway page. > > >