Current location: Hot Scripts Forums » General Web Coding » JavaScript » browser detect


browser detect

Reply
  #1 (permalink)  
Old 03-18-05, 07:36 AM
pagetta pagetta is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
browser detect

Hi ,

I just need a really simple browser detect script, so if it's IE it prints one thing, and for anything else it prints another.

I have looked around but I have not much experience in javascript so I don't know what's best.

sorry this is a newbie question, thanks in advance for any help!
Reply With Quote
  #2 (permalink)  
Old 03-22-05, 01:16 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Here's a quick an ugly way to detect IE browsers...

Code:
<SCRIPT> 

if (navigator.appName == "Microsoft Internet Explorer") {
	// Do something here if it's IE
}
else {
	// DO something else	
}

</SCRIPT>
Reply With Quote
  #3 (permalink)  
Old 03-28-05, 08:21 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
why cant you people ever search on google??

http://www.google.com/search?q=javas...browser+detect
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser independent plug in Vinitha JavaScript 1 02-25-05 05:09 AM
any suggestion...open another browser? aspuser25 ASP 4 08-25-04 12:59 AM
JScript to make no menubar and detect keyboard routine weilies Script Requests 0 04-03-04 09:05 PM
How to supress security prompt in Mozilla browser rameshreddy74 JavaScript 0 01-13-04 11:53 PM
What can I use to update excel sheet on the fly using a browser? mysticwar PHP 1 06-17-03 01:23 AM


All times are GMT -5. The time now is 10:43 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.