Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
17
rated 0 times [  18] [ 1]  / answers: 1 / hits: 16423  / 13 Years ago, fri, september 2, 2011, 12:00:00

I came across this error only on IE9:




SCRIPT575: Could not complete the operation due to error c00c023f.




The error happened on this line: if ((a.responseXML) && (a.readyState==4)) {



I cant figure it out why this happened, and it seems to work very well in other browsers.



and this is my javascript code:



var a = new XMLHttpRequest();
a.open(GET,'/cust/ajax/getresult.php?qk=nnf87&arg1='+pzid,true);
a.onreadystatechange = function () {
if ((a.responseXML) && (a.readyState==4)) {
var N = a.responseXML.getElementsByTagName('result')
sequence = N[0].firstChild.data;
var SEQ = sequence.split(,);
var num = SEQ.length;
var sum = 0;
for(var n=0;n<num;n++){sum = sum + (SEQ[n]*1);}
//document.getElementById(the_number_of).innerHTML = sum;
var date = new Date();
date.setTime(date.getTime()+(2*60*60*1000));
document.cookie='cpa_num='+sum+'; expires= '+date.toGMTString()+'; path=/';
}

}

More From » ajax

 Answers
48

I don't suppose your request is being aborted? A quick Googling found this blog post. It would seem that an aborted request in IE9 will give this error when trying to read any properties off of the XMLHttpRequest object.



From the post, their particular problem with this error code could be duplicated by:




  • Create a XMLHttpRequest object

  • Assign an onreadystatechanged event handler

  • Execute a request

  • Abort the request before the response has been handled




You will now see that the readystatechange handler will be called,
with the readystate property set to '4'. Any attempt to read the
XmlHttpRequest object properties will fail.




The author mitigates this problem by assigning an abort state to the request when the manual-abort is performed, and detecting it and returning before trying to read any other properties. Though this approach would only really work if you are performing the abort yourself.



A similar problem was documented on the this WebSync Google Groups post. Towards the end of the discussion there is an implication that this problem only occurs




if you've got the standards and IE9 rendering
modes both set




Hope that points you in the right direction.


[#90294] Thursday, September 1, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cadendericki

Total Points: 482
Total Questions: 109
Total Answers: 103

Location: Ecuador
Member since Thu, Jun 4, 2020
4 Years ago
cadendericki questions
Wed, Apr 7, 21, 00:00, 3 Years ago
Wed, Jul 8, 20, 00:00, 4 Years ago
Thu, May 14, 20, 00:00, 4 Years ago
;