I want my error function to work in a specific way such that it should display error corresponding to the json file that is not laded. I want error function to display massages like business.json not loaded, Energy.json not loaded, accordingly when I click on any of the corrisponding link "business", "energy", etc.
The key variable holds the value for each json file. For example it would have business.json if i click "business" link on my page
my code is:
$.ajax({
url: "./"+key + "?"+ new Date().getTime(),
dataType: 'json',
success: function(courses){
currentResults=courses;
populateSubCat();
$("#kss-spinner").css({'display':'none'});
},
error: function(key) {
//console.log(xhr.Status);
if(key != "business.json"){
console.log('business.json not loaded ');
}
}
});