[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 07-01-2008, 01:21 AM   #1 (permalink)
New Member
 
Join Date: Jul 2007
Posts: 9
0.00 NP$ (Donate)

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
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, 11:38 AM   #2 (permalink)
New Member
 
Join Date: Jun 2008
Posts: 20
0.00 NP$ (Donate)

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-07-2008, 11:05 PM   #3 (permalink)
NamePros Member
 
Join Date: Jun 2008
Posts: 94
14.35 NP$ (Donate)

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-07-2008, 11:11 PM   #4 (permalink)
NamePros Legend
 
weblord's Avatar
 
Join Date: Dec 2005
Location: Philippines - www.Nabaza.com
Posts: 19,840
21,700.43 NP$ (Donate)

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
weblord is offline  
Closed Thread


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

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


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:03 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85