Problem: Flash in iframe in Firefox doesn't display

Discussion in 'Javascript' started by chaitatp@gmail.com, Aug 4, 2005.

  1. Guest

    Hi friends,

    I've got a problem about inserting Flash in iframe in Firefox. The
    codes are:

    ---- test.html ----
    <html>
    <head>
    <script type="text/javascript">
    function doBodyOnLoad()
    {
    var myIFrame = document.getElementById('myIFrame');
    myIFrame.contentWindow.document.designMode = 'on';
    }

    function doPaste()
    {
    var myIFrame = document.getElementById('myIFrame');
    var currentSelection = myIFrame.contentWindow.getSelection();
    var currentRange = currentSelection.getRangeAt(0);

    // var html = "<b>hello world</b>";
    // var html = '<img
    src="http://mail.google.com/mail/help/images/logo.gif"/>';
    var html = '<EMBED src="http://thaiunix/~chaitat/GOT/MacOS.swf"
    quality="high" menu="true"
    pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
    type="application/x-shockwave-flash" width="114" height="76"></EMBED>';

    if (html != null)
    {
    // Assume Firefox
    currentRange.insertNode(currentRange.createContextualFragment(html));
    }
    }
    </script>
    </head>
    <body onLoad="doBodyOnLoad();">
    <input type="button" onClick="doPaste();"/>
    <iframe id="myIFrame" src="test2.html" width="100%"
    height="50%"></iframe>
    </body>
    </html>

    ---- test2.html ----
    <html>
    <body>
    </body>
    </html>



    When I click the button, the Flash is inserted but doesn't display. I
    need help. Thank you very much.

    Y_Y
     
    , Aug 4, 2005
    #1
    1. Advertising

  2. Guest

    This way I can use to insert "image" or other tag like, for example,
    <B>, <I>, ...
    Also Flash (<EMBED>) but it doens't display.
     
    , Aug 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernie
    Replies:
    0
    Views:
    630
    Bernie
    Sep 5, 2004
  2. Daedalous
    Replies:
    3
    Views:
    788
    Daedalous
    Jan 16, 2004
  3. Cliff R.
    Replies:
    6
    Views:
    163
  4. Replies:
    1
    Views:
    108
  5. Sura
    Replies:
    1
    Views:
    157
Loading...

Share This Page