Old 10-28-2007   #1 (permalink)
Registered User
 
Join Date: Oct 2007
Posts: 43

Send a message via MSN to Neo824
Exclamation Javascript [navigator.appCodeName] help.

For some reason the code below does not work.

Code:
HTML -
<!--Browser Suggestion-->
<div class="browser_suggestion">
<script type="text/javascript">
if (navigator.appCodeName != Mozilla)
{
document.write("This website is best viewed with Mozilla")
}
</script>
</div>

CSS - 
/* Browser Suggestion */
.browser_suggestion
{
margin: -215px 0px 0px 105px;
font-size: 24px;
}
Can anyone help? Thank you.
Neo824 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-29-2007   #2 (permalink)
PHP Lover
 
Join Date: May 2007
Location: Zug, Switzerland
Posts: 84

Using the navigator object to detect client's browser have a look there, it describes how to find the browser. Now the only problem with what you have is that for appCodeName, Internet explorer also returns Mozilla :P
__________________
You can call me Greg or Greggy, as you wish
Gjbphp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-29-2007   #3 (permalink)
Rusty Bio-Hazard!
 
notjustgraphics's Avatar
 
Join Date: Sep 2006
Location: Toronto, Ontario, Canada
Posts: 1,034

Send a message via MSN to notjustgraphics
also, your div appears to be positioned off screen by negative margins, so even if the script does work, you will not see the script output.

Mike.
__________________
notjustgraphics is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript to capture event for restore down or maximize jadeite100 HTML / PHP / ASP / JS 0 05-31-2007 02:12 PM
Sending Javascript to VBScript... impossible? LXNDR HTML / PHP / ASP / JS 1 04-24-2007 07:53 AM
Javascript Help...Disabling Right Click On Web Pages Neil_8_24_93 HTML / PHP / ASP / JS 6 08-13-2006 05:32 PM
Adobe Photoshop CS2 Official JavaScript Reference Man1c M0g Announcements 0 10-19-2005 09:31 PM


All times are GMT +1. The time now is 01:47 AM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2007 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT