Posted by Philip Ronan on 06/29/05 15:39
"christian9997@hotmail.com" wrote:
> Hi
>
> We have started off using a $_GET parameter to keep track of the user's
> browser:
Bad idea. Unless you don't really care what happens when people share links
to your site, or visit your site from search engines.
> 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=IE" or "&browser=DOM" at the end of the url (and we keep the
> browser parameter in the URL the whole time he is on the website),
That is probably going to damage your search engine ranking.
> this
> enables us to use the following PHP method:
>
> function javascript($name) {
> if($_GET[brow] == "IE") {
> return "document.all('$name')";
> }
> else {
> return "document.getElementById('$name')";
> }
> }
Has it not occurred to you that you can do all of this in Javascript?
function getObject(n) {
if (document.all) return document.all(n);
else return document.getElementById(n);
}
Here are a couple of links for you:
http://www.google.co.uk/search?q=javascript+object+detection
http://en.wikipedia.org/wiki/KISS_principle
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Navigation:
[Reply to this message]
|