Whats I"m Up To

3.02.2004

This Looks Like A Job For...Me!

Well you see, I discovered I had a little problem with Mozilla, it had some problems with the menu. In Internet Explorer it required line breaks(they make stuff go on the next line down), and Mozilla didn't need those same line breaks it did it automatically, so in certain places it went down 2 lines making some gaps in the menu. So I had to find some code that would be able to tell which webbrowser a person was using and then added or removed the line breaks when necessary. This is something many sites need especially big company websites, since there are a lot of browsers, and other people who don't use updated browsers. A lot of sites use that kind of code to make different versions of their website appear depending on which browser a person uses so it always looks correct. But it was suprisingly hard to find. One easy way would have worked except for the fact that Internet Explorer and some other browsers don't Identify themselves as what they actually are.

Internet Explorer tells the Site something like this:
Mozilla/4.0 (compatible; MSIE 6.0)
But every version of Internet Explorer says something slightly different

Mozilla Browsers tell the Site something like this:
Mozilla/5.0 ( ) Gecko/20040206 Firefox/0.8
plus their are a few different Mozilla Browsers so they all say something slightly different

This made my job annoying. Everyone had all these ways that supposedly worked but didn't, so I had to go mess with some guy's code that had a good idea, but didn't work because it tried to do 2 things at once, which made it not work. But I got it to work now by finding words that uniquely identify each browser in that line that's up above. I used a function that could search that line of information for specific words, Netscape is simply "Netscape", Internet Explorer is "MSIE", Mozilla is "Gecko" . If anyone else uses another browser that these 3 and the site looks wrong tell me.

No comments: