Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to code for older browsers?

Status
Not open for further replies.

joelwenzel

Programmer
Jun 28, 2002
448
Hi,

I'm creating a website (actually I've already created it) and it use a bit of DOM and CSS. How do I make it compatible with netscape 4.5 (right now it doesn't work with netscape 4.5)
 
What I mean specifically, is what do I have to do for compatibility issues?

Do I have to right <b class='something'> instead of <b class=something>?

Is there a way to comment out javascript DOM code that might not be compatible?
 
one approach that i've seen with javascript is to use branching based on tests for supported features.

for example...

Code:
if (document.layers)
{
  //code for browsers that support layers
}
if (document.all)
{
  //code for browsers that support the &quot;all&quot; syntax
}
if (document.getElementById)
{
  //code for browsers that support standard DOM
}

as far as css is concerned, i don't believe you need to worry about hiding incompatible css. if the browser doesn't support a given css implementation, it simply will ignore it. you do need to be concerned about how the page will end up looking, however, when an older browser doesn't support a css feature that you're using.

glenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top