| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| New Member | 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. |
| |
| | #2 (permalink) |
| New Member | 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 |
| |
| | #3 (permalink) |
| NamePros Member | you can also have a look at YUI YAHOO.env.ua : http://developer.yahoo.com/yui/examp...detection.html |
| |
| | #4 (permalink) |
| NamePros Legend | here's something for you to read: http://www.w3schools.com/js/js_browser.asp http://www.pageresource.com/jscript/jbrowse.htm |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |