By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,501 Members | 1,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,501 IT Pros & Developers. It's quick & easy.

Iframe disappearing when using designMode in FireFox

P: 1

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,


Oct 20 '07 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 5K+
P: 5,390
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
Oct 20 '07 #2

P: 31

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.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:
Expand|Select|Wrap|Line Numbers
  1. function writeWYSIWYG()
  2. {
  3. ;
  4.           document.write(...);
  5.           document.close(...);
  6. }
  7. setTimeout("writeWYSIWYG", 4000);
Hope that helps!
Oct 22 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.