Forum Moderators: open
<script language=javascript>
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")
{send the viewer to MSIE_home_page.htm}
else
if (browserName == "Netscape")
{send the viewer to Netscape_home_page.htm}
</script>
And the other browsers are good too and idealy I want my pages to work with all browsers so anyone can view them. And writing the code for Netscape is about as much as I can do for now. But you're right. When I first started this project I asked myself the question "Which browser should I use to test the pages?" And my almost immediate answer was "Every browser I can find." And who knows. I might get lucky and some of the other browsers may work with the code I've already written.
...who knows. I might get lucky and some of the other browsers may work with the code I've already written...
This is the problem--it show's you're approaching the problems of cross-browser rendering consistency from the wrong angle. Right now, you're trying to respond to browsers' rendering inconsistencies, when you should be trying to prevent them instead.
Take Fotiman's advice, abandon the detection scripts. I might go so far as to say that js browser detection scripts are always a sign that somebody on the team didn't do their homework... Believe it or not, it's easier to write pages that simply work in all (or most) browsers than it is to write pages specifically designed to work in browsers a, b and c as you're doing now.
It's all about the approach. Start by making sure every page you create passes both the w3c's html [validator.w3.org] and css [jigsaw.w3.org] validators. This step alone will fix most major cross-browser rendering inconsistencies.
Then, try to come to grips with css (which will unfortunately mean you have to start learning about the problems with the most sophisticated product ever to come out of the bug-factories in Redmond: Internet Explorer...)
-b
I've been working hard on what I got and I'm going to go with what I've got for now and take a much needed break.
Ditching the browser detection will be in the next set of changes, but I have to take a much needed break before starting that.