Question: JS detection vars "brow" versus "mo
Mark Smit
Status: Curious
Joined: 25 May 2005
Posts: 6
Location: Netherlands
Reply Quote
In the full-featured JavaScript detection file (which I am planning to use unmodified apart from adding a prefix to all global vars in order to avoid conflicts with other scripts), I noticed that variable "brow" does not contain a browser name for Mozilla browsers. What is the reasoning behind this?

For now, in order to have a nice browser string for display to end users, I have simply added the following to my script:

if (typeof moz_brow != "undefined") {
brow = moz_brow;
var moBrowName = moz_brow + " " + moz_brow_nu;
} else {
var moBrowName = brow + " " + nu;
}

If I am missing the point, please let me know!
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
That's a good idea. I have to admit that I've completely stopped using the javascript browser detection on sites, I only use php browser detection currently, but you've found some nice fixes and improvements which I'll add to the main script since it tightens it up a bit, thanks.
Back to top
Mark Smit
Status: Curious
Joined: 25 May 2005
Posts: 6
Location: Netherlands
Reply Quote
Do you plan to keep the scripts updated in the future? When I found your site I thought it was a great idea to share the knowledge about browser detection, and obviously it would be great if people were to keep contributing...

I like the client-side detection because it works well even when the page is tested locally and when serving it from Tomcat...
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
The client side browser detection doesn't require much updating, except for small fixes like the ones you noted. That's because there is a very small set of browsers out there that will execute javascript, so it doesn't need to change much, just to handle new js supporting browsers like safari etc.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours