Reprinted] "unable to open the Internet site has terminated operation" SOLUTION

Source: Internet
Author: User

[Reprint] solution to "unable to open Internet site terminated operation"


16:59:03 technology | comments (0) | browsed (5804) wrote a Javascript script for the pop-up advertisement. The result is normal in Firefox, internet Explorer prompts "unable to open the Internet site has terminated operation" error. After a Google review, I found the cause of the problem after finding N for a long time.

This article from cnlei. blog (http://www.cnlei.org/blog/article.asp? Id = 501) by cnlei

In IE, when the page has not been fully loaded, if the JavaScript code being executed contains the document. if createelement is used, page loading may fail. the message "Internet sites e cannot open Internet site http://www.xxx.com/xxx/xxx.html terminated operation" is displayed ".
This is because:
In IE, during the document loading process, the DOM structure of the entire HTML document has not yet been completely generated, and the JavaScript code being executed has created a new Dom node, the structure of the DOM tree is disordered.
Error-prone Syntax:

<HTML>
<Head>
<Title> xxxxxxxxxxxx </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Meta name = "author" content = "fengyan, cnlei"/>
<Meta name = "Copyright" content = "cnlei.y.l@gmail.com, http://www.cnlei.com"/>
<Meta name = "keywords" content = ""/>
<Meta name = "Description" content = ""/>
</Head>
<Body>
Xxxxxxxxxxxxxxxxxx
<SCRIPT type = "text/JavaScript">
<! --

(Function Init (){
$ Win (). Create ({// create a complex HTML Structure
ID: "lwindow_reg ",
Title: "registering a new user ",
Type: "ajax ",
Innerhtml: 'ex_reg.html'
},{
Top: "50px ",
Left: "270px ",
Width: "560px"
});
})();
-->
</SCRIPT>
Xxxxxxxxxxxxxxxxxx
</Body>
</Html>

Solution:

<HTML>
<Head>
<Title> xxxxxxxxxxxx </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Meta name = "author" content = "fengyan, cnlei"/>
<Meta name = "Copyright" content = "cnlei.y.l@gmail.com, http://www.cnlei.com"/>
<Meta name = "keywords" content = ""/>
<Meta name = "Description" content = ""/>
</Head>
<Body>
Xxxxxxxxxxxxxxxxxx
<SCRIPT type = "text/JavaScript">
<! --
(Function (){
Function Init (){
$ Win (). Create ({// create a complex HTML Structure
ID: "lwindow_reg ",
Title: "registering a new user ",
Type: "ajax ",
Innerhtml: 'ex_reg.html'
},{
Top: "50px ",
Left: "270px ",
Width: "560px"
});
};
If (! DWS. BV. isie) {// non-IE browser direct Initialization
Init ();
} Else {
// In IE, prevent the browser from prompting "Internet website e cannot open the Internet site"
If (document. readystate = "complete "){
Init ();
} Else {
Document. onreadystatechange = function (){
If (document. readystate = "complete") Init ();
}
}
}
})();
-->
</SCRIPT>
Xxxxxxxxxxxxxxxxxx
</Body>
</Html>
Related Article

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.