NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page browser javascript to detect if the browser is MAC Firefox and to load a gif

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-01-2008, 02:21 AM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jul 2007
Posts: 9
abadip is an unknown quantity at this point
 



browser javascript to detect if the browser is MAC Firefox and to load a gif


I need an inline browser javascript to detect if the browser is MAC
????: NamePros.com http://www.namepros.com/programming/487982-browser-javascript-detect-if-browser-mac.html
Firefox and to load a gif. If not mac firefox load an SWF.

eg:

detect if Mac firefox if yes load src="/content/flash/WYD03.gif"

if other browser load src="/content/flash/WYD03.swf"

is this possible?

I would need it to be in the code NOT in the header as there are
several swf's on one page and Mac Firefox is making the SWF on top of
all other divs therefore not displaying the divs.

see the problem here beamcreative.com/menutest.aspx

index does not work with .swf files. I have a work around for all
other browsers but Mac/Firefox has a bug that prevents SWF files to be
at the bottom layer.
abadip is offline  
Old 07-07-2008, 12:38 PM   #2 (permalink)
New Member
Join Date: Jun 2008
Posts: 20
kceleb9 is an unknown quantity at this point
 



This is definitely doable - you can directly query the brower agent string - but there is some subtlety involved. Most javascript gurus nowadays frown on direct browser detection - and instead suggest querying for specific browser capability before you use it. That said - in some cases - like you want to directly address your FireFox MAC users with a message relevant only to them - then you need to detect it.

I would suggest using a library such as jQuery - as they have worked this out in more reliable ways - and you don't have to deal with all the edge cases yourself. they have a $.browser() function that you can use to detect the browser.
__________________
- PM me to build Link Exchanges automatically -

LnkPro.com - Link Exchanges for Professionals
kceleb9 is offline  
Old 07-08-2008, 12:05 AM   #3 (permalink)
NamePros Member
Join Date: Jun 2008
Posts: 98
gezzle is an unknown quantity at this point
 



you can also have a look at YUI YAHOO.env.ua :
http://developer.yahoo.com/yui/examp...detection.html
gezzle is offline  
Old 07-08-2008, 12:11 AM   #4 (permalink)
NamePros Legend
 
weblord's Avatar
Join Date: Dec 2005
Location: Philippines - www.Nabaza.com
Posts: 19,785
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
 


Autism Protect Our Planet
here's something for you to read:
http://www.w3schools.com/js/js_browser.asp
http://www.pageresource.com/jscript/jbrowse.htm
__________________
Nabaza.com - Amaia
weblord is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 10:57 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger