Iframe disappearing when using designMode in FireFox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Patropia
    New Member
    • Oct 2007
    • 1

    Iframe disappearing when using designMode in FireFox

    Hi,

    I have an iframe that's using designMode in which I'm loading some code.
    When including an iframe in that code (putting an iframe in the iframe) the entire frame goes blank. This only happens when using firefox, with IE it just shows the iframe.

    Does anyone know how to solve this,

    Thank you very much,

    Greetz,

    Patropia
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    hi ...

    welcome to TSDN ...

    i've moved your thread from the js articles section to the forum for you ... please don't post questions to the articles sections ...

    kind regards

    Comment

    • deuce789
      New Member
      • Aug 2007
      • 31

      #3
      Hi,

      This is a security measure in firefox to stop cross domain exploits, however you can still achieve the desired result by using a little "hack" so to speak.

      Basically, the part of code that writes the content to the iframe (document.open, document.write, document.close) . If you split this off into a seperate function on its own, and delay it for a few seconds, the iframe will stay in the editor without disappearing.

      For example:
      Code:
      function writeWYSIWYG()
      {
      		  document.open(...);
      		  document.write(...);
      		  document.close(...);
      }
      setTimeout("writeWYSIWYG", 4000);
      Hope that helps!

      Comment

      Working...