Incase a img is not found , i am showing an alternate default image this way
var defaultimage = "images/emptyimage.jpg";
divhtml.append('<i><img class = "imgclss" id="'+name+'" src="'+imagename+'" onerror="this.onerror=null;this.src='+defaultimage+'"/></i>');
But in browser console , i am getting this undefined error
Uncaught ReferenceError: emptyimage is not defined
could anybody please help me how to resolve this errors?
I was folowing this link to resolve the issue
how to show alternate image if source image is not found? (onerror working in IE but not in mozilla)