开发者

why window.setTimeout is required to set an iframe's designmode "on" in IE

开发者 https://www.devze.com 2023-01-30 13:22 出处:网络
In my experiment, I have seen that even after window.onload event, window.setTimeout is required to make an iframe editable by setting iframe\'s designmode \"ON\". And this happens in IE, while in Fir

In my experiment, I have seen that even after window.onload event, window.setTimeout is required to make an iframe editable by setting iframe's designmode "ON". And this happens in IE, while in Firefox window.setTimeout is not required. I have not tested in any other browser.

Is it necessary to use window.setTimeout to set an iframe's designmode "ON" in IE?

You can try it from here, http:/开发者_如何转开发/www.nazmulweb.com/site5/demo/iframe/Default.aspx


You should set the designmode='on' when iframe is loaded.


You might be better off setting the contentEditable property of the iframe's <body> to true instead, which I think will work immediately. I've done that in WYSIWYG editors I've written, although now I can't remember why. I'm pretty sure I had decent reasons.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号