SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Jun 26, 2008, 21:03 #1
- Join Date
- Nov 2007
- Posts
- 35
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Conditional comment for Firefox check
Is there conditional comment to detect Firefox? Like we do for IE with <!--[if IE]>...<![endif]-->?
Or, is there any other client side check?
-
Jun 27, 2008, 05:27 #2
Firefox doesn't have an equivalent to IE's non-standard use of conditional comments (as far as I know).
There might be some javascript browser sniffing you can do?
On the server side, you can check your user agent with something like this;
Code:$isFirefox = preg_match('/firefox/i',$_SERVER['HTTP_USER_AGENT']) ? TRUE : FALSE; if($isFirefox) echo "<p>Yep, using Firefox</p>"; else echo "<p>Nope, some other browser</p>";
You should have a really good reason for discriminating by browser.Last edited by fattyjules; Jun 29, 2008 at 20:01.
-
Jun 27, 2008, 14:49 #3
-
Jun 29, 2008, 20:02 #4
Quite right logic_earth. Post edited accordingly.
Bookmarks