Jquery ajax request error callback is called instead of success even after response recieved from server
Posted
by
Muhammad Tahir Butt
on Stack Overflow
See other posts from Stack Overflow
or by Muhammad Tahir Butt
Published on 2013-11-07T15:51:08Z
Indexed on
2013/11/07
15:53 UTC
Read the original article
Hit count: 378
jQuery
I am using jquery ajax funtion to get some content from my webservice. Response from the server is received but every time error callback is called instead of success callback.
And this error is returned in xhr.error:
function (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this}
Here is the screenshot of response from server:
and here is the code i am using to make the request:
function abcdef()
{
$.ajax({
url: "http://192.168.61.129:8000/get-yt-access-token/",
type: "GET",
contentType:"application/json",
error: function(xhr, textStatus, errorThrown){
alert("its error! " + xhr.error);
},
success: function(data){
alert(data);
}
});
}
© Stack Overflow or respective owner