IE8 doesn't support map because it has been added in ES5.
In case you want to add a shim for that have a look at this polyfil from the MDN website:
if (!Array.prototype.map) {
Array.prototype.map = function (fun /*, thisArg */ ) {
"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 = new Array(len);
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++) {
// NOTE: Absolute correctness would demand Object.defineProperty
// be used. But this method is fairly new, and failure is
// possible only if Object.prototype or Array.prototype
// has a property |i| (very unlikely), so use a less-correct
// but more portable alternative.
if (i in t)
res[i] = fun.call(thisArg, t[i], i, t);
}
return res;
};
}
Otherwise just write your own function to create a new object with the values you want of the input.
mapis available in IEs > 8. If you're using newer version, check the DTD is properly declared.data = $.map(data, function(d) { return +d; });.get()at the end of that, right? Or am I thinking of something else?jQuery#map, notjQuery.map. (How's that for robust API design? ;-) )