I've tried several answers posted in the site like:
How to check if JSON return is empty with jquery
And no one is working for me.
xhr.onload = function(){
detalles = xhr.responseText;
console.log("log : "+detalles);
....
}
Console output:
log : [0]
Firefox debugger network tab shows JSON 0: 0
Any help provided will be much appreciated.
EDIT - Adding some more code to extend the context
xhr.onload = function(){
detalles = xhr.responseText;
console.log(detalles);
if((!$.trim(detalles))||($.isEmptyObject(detalles))||(!detalles[0])){
console.log("ok");
$("#graficohist").html("No info available");
triggerLoader();
}