Opera9.5 small question about IFRAME editing mode

Source: Internet
Author: User
Editframewindow → IFRAME object. contentWindow
1 editframeworkerdoc ument. designMode = 'on ';
2 editframeworkerdoc ument. open ();
3 editframeworkerdoc ument. writeln ('<HTML> 4 editframeworkerdoc ument. writeln ('5 editframeworkerdoc ument. Close ();

The IFRAME can be edited normally in IE6 +, opera9 + (excluding 9.5), ff2 +, and safari. If you write opera9.5, the IFRAME cannot be edited or an error is returned. The problem is as follows:

1 editframeworkerdoc ument. open ();
2 editframeworkerdoc ument. writeln ('<HTML> 3 editframeworkerdoc ument. writeln ('4 editframeworkerdoc ument. Close ();

This code is written to allow ff2 + to be edited normally. other browsers can ignore this code, but opera9.5 cannot be ignored now.

The solution is to judge and execute the ff2 + (gecko kernel) browser.

1 editframeworkerdoc ument. designMode = 'on ';
2 If (navigator. useragent. indexof ('gecko ')>-1 & navigator. useragent. indexof ('khtml') =-1 ){
3 editframeworkerdoc ument. open ();
4 editframeworkerdoc ument. writeln ('<HTML> 5 editframeworkerdoc ument. writeln ('6 editframeworkerdoc ument. Close ();
7}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.