whammy
09-22-2002, 07:17 AM
Edit:
After quite a bit of research, I've given this up as a bad idea (even though it wasn't mine originally) - since browsers can give false HTTP headers, and there is little or no correlation between header information from one browser to the next. (Surpise, surprise... I'm sure a lot of you were already aware of that...)
This blurb from http://www.xs4all.nl/~ppk/js/support.html finally convinced me (even though I was aware of this already as regards to javascript):
"If you want to know whether the browser that views your page supports certain objects you want to use in your code, you should never EVER use a browser detect. Sure, you know that this–and–that browser will support your code while such–and–so browser won’t. But how about other browsers, obscure browsers?
While browser detection works well enough for 90% of your visitors, some obscure browsers won't be treated correctly and browsers that appear after you've written the page may not be adequately covered either. The results would be either a stream of error messages or a script that isn't called while the browser can easily handle it. In both cases, you're cheating your end users and coding incorrectly."
The really sad thing is ASP comes with a built-in function to detect browsers, but it apparently functions a lot worse than the script I was using (surprise, again!).
Thanks to the people who did help, though - it was an interesting experiment, and I got a lot of practice in string manipulation in ASP. ;)
Probably a better script would be one that detects the level of support in browsers and puts those into variables to send to the server with a tricky pixel ... but I'm going to leave the javascript part of that one up to jkd or one of the other real javascript gurus for now. :)
This thread can be closed!
Hello everyone,
I'm working with Mhtml to figure out a way to detect browser/version (and not the entire HTTP_USER_AGENT header) with higher accuracy than any method I've seen so far using ASP in combination with javascript where necessary...
If you have a couple of minutes to spare, please visit this link:
http://www.solidscripts.com/getbrowserinfo/getbrowser.asp
And please copy and paste the complete results you get on the webpage to this thread, including the "Visit Time" - for those browsers that aren't captured immediately by my ASP script, I want to see what my javascript/text file combo recorded for them (I'll compare the time, it will be the same variable).
To avoid wasting anyone's time, the following browsers have already been tested and have returned the correct result:
IE 5.0
IE 5.5
IE 6.0
Netscape 7.0
Netscape 4.79
Netscape 4.78
Netscape 4.77
Netscape 3.01
Opera 6.01
Opera 6.05
If you get browser type "Unknown" (or anything weird!), that's ok!!! - Please paste the results anyway, and let me know what browser you were using.
Thank you in advance for any help! You're helping me to help others as well. :)
P.S. Any suggestions on the Mozilla/Gecko thing? I'm kind of leery about saying "Mozilla X.X" when it seems every browser has "Mozilla" in the USER_AGENT. Should I only write "Mozilla" if no other browser moniker is present in the header? Advice there is appreciated!
After quite a bit of research, I've given this up as a bad idea (even though it wasn't mine originally) - since browsers can give false HTTP headers, and there is little or no correlation between header information from one browser to the next. (Surpise, surprise... I'm sure a lot of you were already aware of that...)
This blurb from http://www.xs4all.nl/~ppk/js/support.html finally convinced me (even though I was aware of this already as regards to javascript):
"If you want to know whether the browser that views your page supports certain objects you want to use in your code, you should never EVER use a browser detect. Sure, you know that this–and–that browser will support your code while such–and–so browser won’t. But how about other browsers, obscure browsers?
While browser detection works well enough for 90% of your visitors, some obscure browsers won't be treated correctly and browsers that appear after you've written the page may not be adequately covered either. The results would be either a stream of error messages or a script that isn't called while the browser can easily handle it. In both cases, you're cheating your end users and coding incorrectly."
The really sad thing is ASP comes with a built-in function to detect browsers, but it apparently functions a lot worse than the script I was using (surprise, again!).
Thanks to the people who did help, though - it was an interesting experiment, and I got a lot of practice in string manipulation in ASP. ;)
Probably a better script would be one that detects the level of support in browsers and puts those into variables to send to the server with a tricky pixel ... but I'm going to leave the javascript part of that one up to jkd or one of the other real javascript gurus for now. :)
This thread can be closed!
Hello everyone,
I'm working with Mhtml to figure out a way to detect browser/version (and not the entire HTTP_USER_AGENT header) with higher accuracy than any method I've seen so far using ASP in combination with javascript where necessary...
If you have a couple of minutes to spare, please visit this link:
http://www.solidscripts.com/getbrowserinfo/getbrowser.asp
And please copy and paste the complete results you get on the webpage to this thread, including the "Visit Time" - for those browsers that aren't captured immediately by my ASP script, I want to see what my javascript/text file combo recorded for them (I'll compare the time, it will be the same variable).
To avoid wasting anyone's time, the following browsers have already been tested and have returned the correct result:
IE 5.0
IE 5.5
IE 6.0
Netscape 7.0
Netscape 4.79
Netscape 4.78
Netscape 4.77
Netscape 3.01
Opera 6.01
Opera 6.05
If you get browser type "Unknown" (or anything weird!), that's ok!!! - Please paste the results anyway, and let me know what browser you were using.
Thank you in advance for any help! You're helping me to help others as well. :)
P.S. Any suggestions on the Mozilla/Gecko thing? I'm kind of leery about saying "Mozilla X.X" when it seems every browser has "Mozilla" in the USER_AGENT. Should I only write "Mozilla" if no other browser moniker is present in the header? Advice there is appreciated!