I am getting a Safari only error: TypeError: Result of expression near '...}.bind(this))...' [undefined] is not a function.
These are lines 88-92:
$(this.options.work).each(function(i, item) {
tmpItem = new GridItem(item);
tmpItem.getBody().appendTo($("#" + this.gridId));
this.gridItems.push(tmpItem);
}.bind(this));
Any ideas what is causing this?
Older versions of Safari don't support bind
. If you try this (http://jsfiddle.net/ambiguous/dKbFh/):
console.log(typeof Function.prototype.bind == 'function');
you'll get false
in older Safaris but true
in the latest Firefox and Chrome. I'm not sure about Opera or IE but there is a compatibility list (which may or may not be accurate):
http://kangax.github.com/es5-compat-table/
You can try to patch your own version in with something like this:
Function.prototype.bind = function (bind) {
var self = this;
return function () {
var args = Array.prototype.slice.call(arguments);
return self.apply(bind || null, args);
};
};
but check if Function.prototype.bind
is there first.
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