in reply to html alteration

There are two different aspects here:

In general, it is not a good idea to send out different pages from server side, simply for different browsers.

Update:

Thanks for ViceRaid to follow up and elaborate on my thoughts.

Replies are listed 'Best First'.
Re^2: html alteration
by ViceRaid (Chaplain) on Jul 19, 2004 at 15:10 UTC
    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).