PDA

View Full Version : Mozilla IFRAME


badg0003
06-11-2005, 10:10 PM
Just thought I would pass along this tip, since it was something that had been frustrating me for a few days.

Basically, when interacting with IFRAME's using a Mozilla-based browser, you might notice that if you click on a toolbar item, i.e., Bold, for the first time, that the cursor jumps to the very beginning of the line, or, if you wanted to insert a link, the browser simply wouldn't let you until you repeated the action the second time.

What I figured out was that after first enabling the designMode on the IFRAME in question, you must run a open() and close() operation on said IFRAME. This will clear up the above problems AND, maybe more importantly, allow you to attach mouse and keyboard events to the IFRAME successfully.

Now would anyone out there know why this is the case - why I have to open() and close() the IFRAME in before it works properly? This problem does not seem to affect the IE-based browsers.