Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Javascript page looks different in Mac vs PC!

    Hi all,
    I've recently included a javascript code in one of my webpage to detect for Flash swf files. The code works fine on a PC but when i checked it on a Mac, the page actually has a duplicate of the swf file right at the top of the page.

    The code is as follows:

    ================
    <!-- FLASH DETECTION SCRIPT-->
    <SCRIPT LANGUAGE=JavaScript1.1>
    <!--
    var MM_contentVersion = 6;
    var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ?

    navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
    if ( plugin ) {
    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i)
    {
    if (isNaN(parseInt(words[i])))
    continue;
    var MM_PluginVersion = words[i];
    }
    var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
    }
    else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
    && (navigator.appVersion.indexOf("Win") != -1)) {
    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
    document.write('on error resume next \n');
    document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
    document.write('</SCR' + 'IPT\> \n');
    }
    if ( MM_FlashCanPlay ) {
    document.write('<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
    document.write(' ID="script" WIDTH="295" HEIGHT="243" ALIGN="">');
    document.write(' <param name="movie" value="flash/flash_studio.swf"> <PARAM NAME=quality VALUE=high> ');
    document.write(' <embed src="flash/flash_studio.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="295" height="243"> ');
    document.write(' swLiveConnect=FALSE WIDTH="295" HEIGHT="243" NAME="script" ALIGN=""');
    document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
    document.write(' </EMBED>');
    document.write(' </OBJECT>');
    } else{
    document.write('<IMG SRC="images/flash_rep_studio.gif" WIDTH="295" HEIGHT="243" usemap="#script" BORDER=0>');
    }
    //-->
    </SCRIPT><NOSCRIPT><IMG SRC="images/flash_rep_studio.gif" WIDTH="295" HEIGHT="243" usemap="#script"

    BORDER=0></NOSCRIPT>
    <!-- END FLASH DETECTION SCRIPT -->
    ================

    Any idea why this is happening on a Mac?

    arya

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by aryastark
    Hi all,
    I've recently included a javascript code in one of my webpage to detect for Flash swf files. The code works fine on a PC but when i checked it on a Mac, the page actually has a duplicate of the swf file right at the top of the page.

    The code is as follows:

    ================
    <!-- FLASH DETECTION SCRIPT-->
    <SCRIPT LANGUAGE=JavaScript1.1>
    <!--
    var MM_contentVersion = 6;
    var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ?

    navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
    if ( plugin ) {
    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i)
    {
    if (isNaN(parseInt(words[i])))
    continue;
    var MM_PluginVersion = words[i];
    }
    var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
    }
    else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
    && (navigator.appVersion.indexOf("Win") != -1)) {
    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
    document.write('on error resume next \n');
    document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
    document.write('</SCR' + 'IPT\> \n');
    }
    if ( MM_FlashCanPlay ) {
    document.write('<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
    document.write(' ID="script" WIDTH="295" HEIGHT="243" ALIGN="">');
    document.write(' <param name="movie" value="flash/flash_studio.swf"> <PARAM NAME=quality VALUE=high> ');
    document.write(' <embed src="flash/flash_studio.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="295" height="243"> ');
    document.write(' swLiveConnect=FALSE WIDTH="295" HEIGHT="243" NAME="script" ALIGN=""');
    document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
    document.write(' </EMBED>');
    document.write(' </OBJECT>');
    } else{
    document.write('<IMG SRC="images/flash_rep_studio.gif" WIDTH="295" HEIGHT="243" usemap="#script" BORDER=0>');
    }
    //-->
    </SCRIPT><NOSCRIPT><IMG SRC="images/flash_rep_studio.gif" WIDTH="295" HEIGHT="243" usemap="#script"

    BORDER=0></NOSCRIPT>
    <!-- END FLASH DETECTION SCRIPT -->
    ================

    Any idea why this is happening on a Mac?

    arya

    Have you tried looking here....

  • #3
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is someone implying an infinite loop?

    Sadiq.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •