|
February 12, 2000 Navigator's vs Explorer's DHTML Tips: February 2000
Yehuda Shiran, Ph.D.
|
|
The first complication is that the basic document model is different between the browsers. In Netscape Navigator, all elements are descendents of the top-level document object. In Internet Explorer, though, there is an intermediate level between the top-level document object and the DHTML elements of the page. Let's take the DIV tag as an example for a DHTML element that exists in both Netscape Navigator and Internet Explorer:
A reference to this
while an Internet Explorer's reference to it will be as follows:
The second complication stems from the way properties of DHTML elements are referenced. In Netscape Navigator, the properties are immediate descendents of the DHTML object. In Internet Explorer, though, the properties are descendents of the style object, which is a descendent of the DHTML object. Continuing our previous
while it is referenced in Internet Explorer as:
The third complication is that properties with matching names do not behave exactly the same in both browsers. The classic example here is the DHTML's The fourth complication is the way these browsers reference HTML elements inside the DHTML elements. In Netscape Navigator, you have to access the document object which is a descendent of the DHTML element:
and then reference descendent HTML elements by their
The IMG element's reference in Netscape Navigator is:
and the
The situation in Internet Explorer is much simpler. The
The fifth complication is that some DHTML elements do not support the same event handlers. The Learn more about Netscape Navigator's and Internet Explorer's different DHTML models in Column 27, Differences between Browser's Document Models .
People who read this tip also read these tips: Look for similar tips by subject: |