Departments
 Info
   Home Page
   Articles
   Software Goodies

 Explanations
   How do they do that?
   The Web in Focus

 Resources
   Web Site Stuff
   Tech Books
   E-Books
   Tech Toys
   Web Hosting
   Links

 Women
   Opinion
   Tech Women
   Women's Studies

 Tech News
   Computer Security
   Databases
   Java
   Linux
   MP3
   PC Software
   Robotics
   Site Owner
   Tech Latest
   Web Development
   XML

 Spread the Word
   Newsletter
   Recommend this Page

 Site Info
   Legal Disclaimer
   Privacy
   Contact

 Lighter Side
   Crazy for Life
   crazy for romance
   Crazy for Kitties
   Crazy for Dogs
   Crazy for Cows

Copyright 2000-2001, hertechnology.com

 
The Web in Focus
Popup Text

Browser Differences

But first, consider some browser differences. Both browsers have what is called a Document Object Model (DOM) that describes how the browsers represent, at a high level, what gizmos are on the web page. IE keeps track of all of the gizmos in a general grouping called document.all. NN, however, puts things in a hierarchical structure. If you create DIVs or LAYERS, the things inside those tags will be referred to using a document.something.document.somethingelse notation. In this example, the name of the DIV is div1. So in NN we use document.div1, and in IE we use document.all.div1.

Both browsers let you apply styles to various entities, and they both let you position an entity with the properties top: and left:. Fortunately, they also agree on the property that controls whether you can see something or not -- namely, the visibility: property. And they even agree on the values -- visible and hidden. We use the style property visibility: to control whether you can see the box or not. The browsers do have a different syntax for setting the style properties. In NN, we'll say document.div1.visibility='visible', and in IE we use document.all.div1.style.visibility='visible'.

The two browsers also agree on the events that you can use to detect whether the mouse is over the object you want to work with -- onMouseOver, and whether you've clicked something or not -- onClick. But NN limits you to the objects that you can detect events on. You can detect events on A HREF links, but not on DIV tags.

Browser Detection

I'm following the recommendations from Web Reference and am determining what browser I'm working with by looking at what DOM I've got. The code is:

var IE = (document.all) ? 1 : 0;
var NN = (document.layers) ? 1 : 0;

Page 3

Tech Books

Tech Toys

More News

  Want to bookmark this site? Press Control-D. (Hold down the control key and the letter D at the same time.)