View Full Version : JS redirect for Firefox causes site not to load in IE!
I have a site that is entirely Flash, but I also have an html version since Firefox has issues with .swf and .flv files. I used the following code for when the user is viewing in firefox to direct them to the html version, but this code also prevents the flash site from opening in, shocker, IE. Is there a hack or something to work around this to get it to work in IE - PLEASE!
if(navigator.userAgent.indexOf("Firefox") != -1)
{
window.location = "http://www.meridianbiogroup.com/index2.htm";
}
else if(navigator.userAgent.indexOf("MSIE") != -1)
{
window.location = "http://www.meridianbiogroup.com";
}
bluewalrus
11-12-2010, 05:56 AM
Why arent swf or flvs working in firefox? There is not a known problem with swfs/flvs and ff; with a majority of users using ff you should solve that problem rather than hack around something else.
Also note that swfs arent the same as flv, flvs are flash video files and swf are, in short, shockwave files so I'd solve the problem first is the problem with your swfs or flvs then why is it so...
If you post a link or code we could probably help you further.
jscheuer1
11-12-2010, 07:11 AM
bluewalrus is right, this works fine in IE and Firefox, probably many others:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="960" height="600">
<param name="movie" value="Meridian.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="9.0.45.0" />
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!--[if !IE]> <-->
<object data="Meridian.swf" width="960" height="600" type="application/x-shockwave-flash">
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="menu" value="false" />
<param name="swfversion" value="9.0.45.0" />
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
</object>
<!--> <![endif]-->
<!--[if IE]>
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<![endif]-->
</object>
The problem with your rediredt code though is that it shouldn't redirect at all for IE, because it's already on the proper page. The way you have it in your post there, it would at best go into an endless loop in IE.
Well I have had issues with FFox and have read up on them as well. I do know the dif between a .swf and .flv file and am just as baffled as to why it's not working when I've actually had other .swfs play in FF w/out issue.
The site is: www.meridianbiogroup.com. When I attempt to open it in FF here is the error I get:
"Content on this page requires a newer version of Adobe Flash Player."
I do have the latest player installed. I've double and triple checked that and I still get this issue. My client is also receiving this error.
I really appreciate everyone's replies - every bit helps! =)
jscheuer1
11-12-2010, 05:57 PM
Replace:
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="960" height="600">
<param name="movie" value="Meridian.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="9.0.45.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="Meridian_CS3.swf" width="960" height="600">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="9.0.45.0" />
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
with:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="960" height="600">
<param name="movie" value="Meridian.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="9.0.45.0" />
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!--[if !IE]> <-->
<object data="Meridian.swf" width="960" height="600" type="application/x-shockwave-flash">
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="9.0.45.0" />
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
</object>
<!--> <![endif]-->
<!--[if IE]>
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<![endif]-->
</object>
John, thanks a ton - I'll give it a go!
OK, so unfortunately nothing worked. I did create another Flash file that skipped the opening movie which DOES open in Firefox. So with that I only added the follow redirect code for Firefox..
if(navigator.userAgent.indexOf("Firefox") != -1)
{
window.location = "http://www.meridianbiogroup.com/home.html";
}
</SCRIPT>
The problem now is that it won't open in Firefox on the PC side and it's also now not opening in Chrome...
Suggestions?
jscheuer1
11-16-2010, 08:40 PM
Funny, works fine here:
http://home.comcast.net/~jscheuer1/side/flash_1_h.htm
John, what OS are you on and in what browsers are you seeing it in?
Thanks for the reply!
jscheuer1
11-17-2010, 03:58 AM
Windows 7. IE 8 (in IE 8 and IE 7 modes), IE Tester in IE 6 mode, Firefox 3.6.12, Opera 10.63, Chrome 7.0.517.44, Safari 5 Win.
All using Adobe Flash Player 10,1,102,64.
Why? What OS, browser, and Flash version is giving you trouble on my demo page?
Sorry, I had just clicked your link and didn't realize this was on your demo page. What did you differently to make it work, and how do I go about the fix? Thanks!
jscheuer1
11-17-2010, 07:33 PM
I used the code I suggested in post #5 (http://www.dynamicdrive.com/forums/showpost.php?p=241230&postcount=5) of this thread.
You may also use your browser's 'view source' when looking at my demo to see its code.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.