Detailed solution for Error (c00ce56e) when Ajax is used in php

  • 2021-07-24 10:21:28
  • OfStack

Today, when writing code, ajax is used to obtain data asynchronously, which is normal under firefox 13.0, while IE6 is normal under various versions of IE, but IE8 will report an error "Error: this operation cannot be completed due to error c00ce56e". Because firefox is the browser I write code and do tests, so 1 will first guarantee the correctness under it, and 1 cut under firefox looks so normal.

My environment is: js code is based on jQuery, using asynchronous loading mode to load each js class library, the request mode is' GET ', and the return format is' html ';

Due to the completion of the previous work in stages, I am ready to see if it is normal under IE. I am a little depressed and have no response.. The data is not displayed. Then under IE, F 13, I found that there was nothing wrong with requesting data under IE, and I also got the data in the control panel, but when I used $('# id'). html (data); When inserting data into DOM, there is no response at all.

Continuing debugging, and then in the error parameter option of the $. ajax request, alert passed to the errorThrown parameter of the callback function, I got the following error: "This operation cannot be completed because of the error c00ce56e." This is critical, because the pop-up error has code, so this is a traceable error.

By the way, the ajax request returns success under firefox and error under IE. According to this error prompt, I searched the relevant answers on the Internet, and found a more useful statement that the code is not 1. After searching, it was found that the code of my html page was utf-8, and the code set in my php program was header ('Content-type: text/html; charset=utf-8 '); This is depressing, and there is no problem with one kind. Later, when I checked the source code of the page, I found out how it was utf8. Where did I run without one '-' This'-'? Later, I found that charset utf8 was set in the original nginx configuration; Forced character encoding for utf8, quickly plus restart nginx1 cut normal. . .

According to this problem, the following experiences can be summarized:

The fault tolerance of firefox is stronger than that of IE. In terms of the design idea of HTML5, firefox performs better. Whether such fault tolerance will cause potential safety hazards is unknown for the time being because it has not been tested;
Try to keep all kinds of coding of the program, otherwise unpredictable errors may occur, and it is recommended to use utf-8;


Related articles: