in reply to Re: html alteration
in thread html alteration

For JavaScript, deal with the differences on client side, let your JavaScript handle it. JavaScript can detect the browser type, and for different types, you might need different syntax (this is life), and also some browser do not support certain things.

This is getting OT, but when doing compatibility coding for client-side Javascript, it's generally a better idea to test for the availability of the given methods or variables you want to use, rather than parsing the UA string (on the server-side, you don't have this luxury). This, by the by, is another reason to do client-compatability coding on the client-side. Anyway, here's an (untested) example:

var foo; if ( document.getElementById ) { foo = document.getElementById('foo'); } elsif ( document.all ) { foo = document.all['foo']; } ...

One of the biggest advantages of this is that it much improves forward compatibility (it should still work when Mozilla v3.0 arrives). It also works when you have a browser that has had its UA-string mangled by a vendor, but is otherwise just a vanilla version of a well-known browser engine (IE, Gecko, whatever).