Internet Explorer prompts "unable to open site XX, operation terminated" SOLUTION

Source: Internet
Author: User
After the project is deployed, this problem sometimes occurs when you open the webpage and refresh the webpage.

Because the appendchild or innerhtml operation of htmlobject is called when the page does not have ready,

Dialog Box: "Internet Explorer cannot open site XXX, operation terminated"

The solution is as follows:

(1) Determine document. readystate = "complete" in the appendchild or innerhtml operations. If no, setTimeout

Perform this operation again in seconds. However, this attribute is only valid for IE and opeara. The document of FF does not have the readystate attribute and is always

Undefined.

(2) Use the defer attribute in the script. It is intended to execute the script after the page is loaded, so that the object cannot be found. Defer not

Checks whether all external files have been downloaded, and determines whether the current page has been fully loaded. In additionCodeBlock cannot be written

Document. Write Method

Method 2: When loading external files, the effect is not good and may cause other unexpected problems.

So the first method is adopted, and the recursive method is used.

Function mytest (){
If (document. readystate = "complete ")
// Execute the Function
Else
SetTimeout ("mytest ()", 1000)
}

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.