This is the line:
songs = songs.filter(function (el) { return el.album==album; });
This is the error:
Object doesn't support this property or method
This Works 100% fine in Chrome. What's going on?
Internet Explorer has a whole bunch of filters for various effects. Unfortunately, the Shadow filter created specifically for making shadows gives an incredibly poor result. But there is a trick we can use here: filter effects can be overlayed on top of each other. progid: DXImageTransform.
Internet Explorer When the "Internet Options" window opens, select the Security tab. On the "Security" tab, make sure the Internet zone is selected, and then click on the "Custom level..." button. In the Security Settings – Internet Zone dialog box, click Enable for Active Scripting in the Scripting section.
Definition and Usage. The filter() method creates a new array filled with elements that pass a test provided by a function. The filter() method does not execute the function for empty elements. The filter() method does not change the original array.
One can use filter() function in JavaScript to filter the object array based on attributes. The filter() function will return a new array containing all the array elements that pass the given condition. If no elements pass the condition it returns an empty array.
Array.filter()
isn't included in IE until version 9.
You could use this to implement it:
if (!Array.prototype.filter) { Array.prototype.filter = function(fun /*, thisp */) { "use strict"; if (this === void 0 || this === null) throw new TypeError(); var t = Object(this); var len = t.length >>> 0; if (typeof fun !== "function") throw new TypeError(); var res = []; var thisp = arguments[1]; for (var i = 0; i < len; i++) { if (i in t) { var val = t[i]; // in case fun mutates this if (fun.call(thisp, val, i, t)) res.push(val); } } return res; }; }
From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter
Or since you are using jQuery, you can wrap your array into a jQuery object first:
songs = $(songs).filter(function(){ return this.album==album; });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With