PDA

View Full Version : Gathering and storing browser data?


easbrandel
10-31-2002, 11:14 PM
Greetings,

I would like to track the browser type/version visitors to my site are using. I have come across numerous examples of scripts for delivering different pages, style sheets, alerts etc.to the viewer according to their browser, but I want to know how many visitors visit the site with what browser. I want to research my audience, before deciding whom to cater to, if anyone. Is there a JavaScript solution for this? Or, should I use a server solution to detect this information. And how might I best compile/store/deliver this information?
Thanks. BTW, I hand-code exclusively.
:)

whammy
11-01-2002, 12:43 AM
Good luck. I researched this for awhile and determined there is no reliable way to detect browser type, since there are no "standards" for the HTTP headers sent in order for you to get this data from.

Your best bet is to cater to the type of javascript the browser is able to render, by using javascript tests themselves... i.e.:

if(document.all){
// do something
}
else if(document.layers){
// do something
}
else if(document.getElementById){
// wow, they have probably have a modern browser!
}

Wish I could be of more help, but I gave it up as a lost cause. :(