I’m using a jQuery ajax call to get several entries from a large set of data and write it out into a table.
I want to change the settings of the ajax calls so that if no entry exists for a given ajax call jQuery should return 0 instead of undefined, is this possible?
Edit:
My call to the file is as follows
$.get('http://ontariosheep.org/mobile/data/data_osi2.php',function(data){
$('.content').empty();
$(data).find('market').each(function(){
...
}
}
Sure it is, assuming the file that is called returns no data at all (completely empty), something like this should work: