Hi
We have started off using a $_GET parameter to keep track of the user's
browser:
We detect what browser the visitor is using when he first arrives on
our website then we do a redirect to the same page adding on
"&browser=I E" or "&browser=D OM" at the end of the url (and we keep the
browser parameter in the URL the whole time he is on the website), this
enables us to use the following PHP method:
function javascript($nam e) {
if($_GET[brow] == "IE") {
return "document.all(' $name')";
}
else {
return "document.getEl ementById('$nam e')";
}
}
That we use like this (for example here we are setting the inner HTML
for the item whose ID is 'contribute'):
<?=javascript(' contribute')?>. innerHTML = "Name";
Everything was working fine but we have realised that the Googlebot
cannot deal with $_GET parameters so we are looking into url rewriting
but it is going to be very complicated to keep the method we are using
with url rewriting.
We would be interested in hearing about the way people deal with
javascript browser compatibility using PHP. There must be some much
simpler ways of doing this but we are not sure how to do it.
Any input would be helpful.
Thanks