Why, why why?... Both Microsoft and Netscape have decided to "change" the way they report things as of version 5. Not for the better mind you, just to mess with us. Special code has to be implemented to detect these newer versions. NN6 reports as version 5, IE5 and IE6 report as version 4. I understand why IE had to change... but Netscape... not sure. All this for something that should be standards driven, "appVersion" has lost what little standards it had.
Detect the browser:
Detect the Version:
Detect the Sub Version:
This requires a little more effort. And guess what....IE5 and NN6 do not report this properly. I have not added code for them here. Many browser versions do not report a two digit sub version as is standard. Some add stuff(like "Gold"). So there really isn't a standard for you to work with. This code will remove any added junk and return a two digit sub version no matter what. This means that a version 3.1 will report a sub version of "01" while 3.10 will report sub version of "10". The only time I ever use sub version is when IE3.02 is involved(it removed functions). you can check the browser sub version by referencing "browsersubver".
Put it all together
Notice I put the alert message after loading new page? It allows page to load while client is busy with message rather than waiting for client to respond to the message(helpful hint).
I set "browser", "browserver" and "browsersubver" variables on one main page and reference them. Thus I do not have to repeat this code. On the CGI site this was done using CGI, not script.
Anyway, I hope this helps those that want it.