// you’re reading...

Javascript

iFrame in javascript wont work in Firefox [solved]

iFrame when enabled in design just wont work in firefox. It wont accept any input, but it works very well in internet explorer. I was working on a rich text editor with iframe and this has been a major problem with it.

i finally resolved this.

Mozilla says this line must be called from by the onLoad() in the body, only then it would work

document.getElementById("rte").contentWindow.document.designMode = "On"

2. All elements in the javascript must by called by this function getElementbyID() .


<script type="text/javascript">
function Init() {
document.getElementById("rte").contentWindow.document.designMode = "On";

}
<body onLoad="Init()">
<iframe id="rte"></iframe>
</body>

You can refer to the mozilla documentation which can be very useful

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • BlinkList
  • blogmarks
  • del.icio.us
  • digg
  • feedmelinks
  • Furl
  • Fleck
  • MyShare
  • NewsVine
  • Netscape
  • Slashdot
  • Spurl
  • StumbleUpon
  • Taggly
  • Technorati
  • Wists
  • YahooMyWeb

Discussion

No comments for “iFrame in javascript wont work in Firefox [solved]”

Post a comment