MyBB Community Forums

Full Version: HTML if statment
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to use this statment for mozilla firefox, can you help me plz.

the one i made for ie (all versions) it works, but when i addapt it for mozilla it dosnt!

<!--[if IE]>

		<script> document.write('<meta HTTP-EQUIV="REFRESH" content="1; url=('url here');</script>

<![endif]-->


the problem i have is the <!--[if mozilla]> it should work and i have tried if firefox and if mozilla firefox but nothing! the script is supported by firefox!
please could someone change the if statment to mozilla.
http://www.quirksmode.org/css/condcom.html

Quote:Conditional comments only work in Explorer on Windows, and are thus excellently suited to give special instructions meant only for Explorer on Windows. They are supported from Explorer 5 onwards, and it is even possible to distinguish between 5.0, 5.5 and 6.0.
I use this for all non IE browsers.
<!--[if !IE]>string<![endif]-->
Altho, if you wanna do it for just firefox you should look at javascript to dectect it.
CraKteR Wrote:I use this for all non IE browsers.
<!--[if !IE]>string<![endif]-->
Altho, if you wanna do it for just firefox you should look at javascript to dectect it.

Ahh.. That's a neat trick, Thanks for sharing. Smile
Well, I did that because of the crappy css support IE has, so I could use some nifty functions in Mozilla Smile
<!--[if !IE]>string<![endif]--> 
so this code...

the if !IE tells ie not to include the code, however the if statment is ignored by firefox, so i should put the redirect code in that if statment for firefox


TY to everyone who posted + rep
If you only want it to do it for firefox you need to use Javascript, that does just ignore in IE not on any other browsers.

Something like...
<script type="text/javascript">
if(navigator.product == "Gecko"  && navigator.vendor.indexOf("Apple Computer") == -1) {
	document.write('<meta HTTP-EQUIV="REFRESH" content="1; url=('url here');
}
</script>
or whatever.