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

    JS/iframe compatibility in IE8?


    I have the following javascript which is setting up a quiz (delivered from off-site) into an iframe. The javascript code determines if the visitor has Flash or not, and then sets up the page, on button click, to deliver the appropriate version of the quiz into the iframe.

    For some reason, this code works in everything (it seems) except IE8. In IE8 without Flash, something (perhaps in the code itself?) kicks the viewer into a blank page. If someone could just test the URL below and tell me if they get the same problem, that would help! Maybe (I am thinking) it is because the computer I tested it on did not have JS enabled? Or maybe there is something in the code? Or maybe with the quiz delivered from off-site?

    Here is the code:
    <!--QUIZ BEGINS-->

    <article id="page_7c">
    <div class="box" id="page1">
    <a href="#page_1" class="close"></a>
    <div class="wrapper pad_bot1">
    <div class="grid_16 prefix_4">

    <div id="tester">



    <!--QUIZ ENDS-->
    // courtesy of http://www.kirupa.com/developer/mx/detection.htm
    function FLASH_CHECK(){
    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])))
    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.getElementById('tester').innerHTML = '<img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://c.gigcount.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEzMTY3MjMyMzUyNDMmcHQ9MTMxNjcyMzIzNzA*OCZwPTIwNDMyMSZkPSZnPTEmbz*wMWFhMzNjMDI4ZWM*NjNmYTZh/NGU1M2FiNzRmZTZlMSZvZj*w.gif" /> <iframe src="http://www.quizrevolution.com/act147691/mini/go/test_your_knowledge_about_ufos" width="380" height="400" frameborder="0" scrolling="no" name="mystudiyoIframe" title="QuizRevolution.com"><a href="http://www.quizrevolution.com/act147691/mini/go/test_your_knowledge_about_ufos">test_your_knowledge_about_ufos</a></iframe>'
    } else{
    document.getElementById('tester').innerHTML = '<img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://c.gigcount.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEzMTY3MjMzMTU3NDUmcHQ9MTMxNjcyMzMxODA5NyZwPTIwNDMyMSZkPSZnPTEmbz*wMWFhMzNjMDI4ZWM*NjNmYTZh/NGU1M2FiNzRmZTZlMSZvZj*w.gif" /> <iframe src="http://www.quizrevolution.com/act147547/mini/go/test_your_knowledge_about_ufos" width="380" height="400" frameborder="0" scrolling="no" name="mystudiyoIframe" title="QuizRevolution.com"><a href="http://www.quizrevolution.com/act147547/mini/go/test_your_knowledge_about_ufos">test_your_knowledge_about_ufos</a></iframe>';
    And here is the URL of the site:

    If you click on the link bottom left ("Test Your Knowledge of UFOs") that should send you to the appropriate version of the quiz.

    Many thanks for any help!

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Thanked 63 Times in 63 Posts
    To narrow down if it is the script or the external file, you should try to test it with a local file (or at least one you host). If it loads your file in IE8, it might just be the quiz...


    Posting Permissions

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