countImage = data.filter(function(value) { return value !== undefined }).length;
This statement return error of Object doesn’t support this property or method, how to fix the problem ? thanks
Update, data is get from ajax and it is an array encoded using json
$imgArray[] = $dir.DIRECTORY_SEPARATOR.$file.DIRECTORY_SEPARATOR.'Pv'.$filePadded.'.png';
die(json_encode($imgArray));
data: {'data':issueString},
success: function (data) {
countImage = data.filter(function(value) { return value !== undefined }).length;
..........
What you get is a javascript array and not a jquery object so you are calling on the Array.prototype.filter method.
If you see the compatibility for IE it is mentioned that it is supported in IE9+.
In that page there is also a method to use for browsers that do not support Array.prototype.filter