Jump to content

Needs some help


The Sea King
 Share

Recommended Posts

I need a script that checks the internet browser and displays this message when the browser isn't Firefox:

<table align="center" bgcolor="#b0e0e6"><tr><td>Website is best viewed with Firefox. <br><a href="http://www.frefox.com">Download Firefox Now <br> <img src="http://img146.imageshack.us/img146/1673/firefoxwx7.png"></a></td></tr></table>

Edit: So far I only have this and I wish to add the above code.

<html><head><script type="text/javascript">function detectBrowser(){var browser=navigator.appName;var b_version=navigator.appVersion;var version=parseFloat(b_version);if ((browser=="Netscape")){document.write("");}else{document.write("Get Firefox");}}</script></head><body onload="detectBrowser()"></body></html>

Link to comment
Share on other sites

This should do it, though I don't really rely on Javascript's prowser detecting function.if(navigator.appName != "Netscape") {document.write('<table align="center" bgcolor="#b0e0e6"><tr><td>Website is best viewed with Firefox. <br><a href="http://www.frefox.com">Download Firefox Now <br> <img src="http://img146.imageshack.us/img146/1673/firefoxwx7.png"></a></td></tr></table>')}

Link to comment
Share on other sites

thanks again. :) ... what would you suggest?
My suggestion is to try to make your sites work on all browsers in the first place. It will show your visitors that you're a good web designer. Most people, if they're using Internet Explorer, will probably ignore your site and leave if you're telling them to download another browser.
Link to comment
Share on other sites

... what would you suggest?
For what you're doing, it's fine. I suspect Ingolme was deprecating the habit of browser checking.In other contexts, some people like to check the browser to see (guess) if a property or method exists, so that they could kludge around it. Today, the savvy hacker will simply check if the property exists, regardless of browser.A typical example:function doodah (event){ var e = event || window.event; return;} Now most of us will recognize the need for this since IE treats events differently than everyone else. But who knows? In the next version they might not. If so, checking for a browser would mean checking for a browser and a version number. Ick. This is actually the way folks did things years ago, and the nested if statements were ugly. Check for the property and you get the same function in fewer statements and less upkeep. Maybe no upkeep.But as I said, your application really does need to do it this way.
Link to comment
Share on other sites

My suggestion is to try to make your sites work on all browsers in the first place. It will show your visitors that you're a good web designer. Most people, if they're using Internet Explorer, will probably ignore your site and leave if you're telling them to download another browser.
It's just the table border in firefox looks better than in IE... Is there any way to make the border the same as in Firefox?
Link to comment
Share on other sites

The only difference I see with the table borders in Firefox and Internet Explorer is that Firefox shows it darker.Something like this CSS could do:table,td { border-style: solid; }table { border-color: #999999 #000000 #000000 #999999; }td { border-color: #000000 #999999 #999999 #000000; }

Link to comment
Share on other sites

ok. thanks.Edit: Is this alright?

table,td { border-style: solid; border-collapse: collapse;}table { border-color: #999999 #000000 #000000 #999999; }td { border-color: #000000 #999999 #999999 #000000; }a:link {color: #ffffff; text-decoration: none; font-style: italic;}a:visited {color: #ffffff; text-decoration: none; font-style: italic;}a:hover {text-decoration: underline;}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...