Home > Jquery Ajax > Jquery Ajax Status 200 But Error

Jquery Ajax Status 200 But Error

The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown error Type: Function( jqXHR jqXHR, String textStatus, String errorThrown ) A I’d stab a guess at an invalid JSON Response. if i call in browser it works fine :/. I am adding my code below: jQuery Code var row = "1"; var json = "{'TwitterId':'" + row + "'}"; $.ajax({ type: 'POST', url: 'Jqueryoperation.aspx?Operation=DeleteRow', contentType: 'application/json; charset=utf-8', data: json, dataType: have a peek here

Join them; it only takes a minute: Sign up Ajax call fires error event but returns 200 ok up vote 7 down vote favorite $.ajax({ url: 'http://intern-dev01:50231/api/language', type: 'GET', dataType: 'json', Browse other questions tagged javascript json api jquery or ask your own question. share|improve this answer answered Jan 30 '14 at 7:57 Paul 284 add a comment| up vote 1 down vote Use the following code to ensure the reponse is JSON format.. (PHP I get the pop-up saying hello when button is clicked.

My problem was, my controller was returning status code instead of Json. function makeSelect() { var blouseoption = document.querySelector('input[name="blouseoption"]:checked').value; var url = "http://dukano.co/sakhidev/retailon/productoption/values"; alert(url); var jsondata = $j('#customoption').serialize(); alert("jsondata: " + JSON.stringify(jsondata)); $j.ajax({ type : 'POST', url : url, data : jsondata, dataType Related 530jQuery Ajax error handling, show custom exception messages360AJAX request return 200 OK but error event is fired instead of success0jQuery Ajax Request 200 but status error0jQuery ajax “error”, status 0,

I managed to fix it by moving datatype above url like this: $.ajax({ type: 'GET', dataType: 'json', url: 'http://intern-dev01:50231/api/language', success: function() { console.log('It Works!'); }, error: function (request,status, error) { console.log(error); Remove the text. Leave a comment on Kevin B's reply Kevin B Re: jQuery calls error callback on successful ajax request (status 200) 6 years ago hmm... Default.aspx :