In the following code I get an error of:
Unable to get value of the property 'deal_score_round_img': object is null or undefined
The debugger reports the value of jdeals[i]['deal_score_round_img'] as:
"<img src=\"assets/deal_scores/80.gif\" width=\"40\" height=\"35\" />"
The error occurs on the first line (typeof).
if(typeof(jdeals[i]['deal_score_round_img'])!="undefined")
{
var nums = jdeals[i]['deal_score_round_img'].match(/([[0-9]+)/ig);
t.deal_score = nums[0];//80
}
The purpose of the script is to extract “80” from the image string.
Any ideas anyone?
It seems that jdeals may be null or undefined, and if that is expected, you want to check it too: