Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check if json data is received in ajax response

$.ajax({
    url: '/my/script.ext',
    dataType: 'json',
    success: function(data, textStatus, jqXHR) { /*YAYE!!*/ },
    error: function(jqXHR, textStatus, errorThrown) { /*AWWW... JSON parse error*/ }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #json #data #received #ajax #response
ADD COMMENT
Topic
Name
7+4 =