|
Departments Info Home Page Articles Software GoodiesExplanations How do they do that? The Web in FocusResources Web Site Stuff Tech Books E-Books Tech Toys Web Hosting LinksWomen Opinion Tech Women Women's StudiesTech News Computer Security Databases Java Linux MP3 PC Software Robotics Site Owner Tech Latest Web Development XMLSpread 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 CowsCopyright 2000-2001, hertechnology.com |
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; |
|