dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Web
Expertise: Intermediate
Mar 5, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Layers or DIVs?

The world of DHTML is a chaotic one right now. Netscape Navigator 4.x and Internet Explorer 4.x have sufficiently different implementations of the Document Object Model (DOM) that cross-browser DHTML development is a real challenge.

A major benefit of DHTML is the ability to wall off an area on the page and treat it as an object, with its own properties and positioning. In Navigator this area is called a <LAYER>; in IE it's a <DIV>. In any cross-browser DHTML document, the first thing to determine is whether the client browser is reading layers or DIVs. You can figure that out with JavaScript:

 
if (document.all) {
	myBrowser = "IE";
	docObj = document.all;
} else if (document.layers) {
	myBrowser = "NN";
	docObj = document.layers;
}
You can then use the myBrowser and docObj variables throughout the program to write the correct term for each browser. You still have to make sure your DIVs and layers have compatible behaviors, but that's a different story.
Steve Renaker
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date