SCRIPT7002 XMLHttpRequest Network Error 0x2ef3, Could not complete the operation due to error 00002ef3

Pranay
Jan 19, 2015  ·  17342 views

This error I came across while making an ajax call using jquery ajax function. After a long analysis I was able to figure it out, so thought of sharing with everyone.

###Error: SCRIPT7002 XMLHttpRequest Network Error 0x2ef3, Could not complete the operation due to error 00002ef3

###Solution: This error I came across while making an ajax call using jquery ajax function. After a long analysis I was able to figure it out.

Set the contentType as ‘application/json; charset=utf-8‘ to resolve the issue.

Example:

$.ajax({
    ...
    data:data,
    contentType:"application/json; charset=utf-8",
    dataType:"json",
    ...
}

If the issue is not yet resolved then it could be improper json data that you are passing. to resolve this addJSON.stringify to the json data you are passing. i.e.,

$.ajax({
...
data: JSON.stringify({
    'param1':'val1',
    'param2':'val2',
    'param3':'val3'
    }),
contentType:"application/json; charset=utf-8",
dataType:"json",
...
}
AUTHOR

Pranay

A Software Engineer by profession, a part time blogger and an enthusiast programmer. You can find more about me here.


Post a comment




Thank you! You are now subscribed.

Sign up for our newsletter

Subscribe to receive updates on our latest posts.

Thank you! You are now subscribed.