JQuery IE links this

In IE, I get this error in the console using jQuery:

SCRIPT438: object does not support property or method 'bind' default.js, line 33 character 3

$.get(URL + 'dashboard/photoList/'+categoryID, (function(o) {
        // code here
}).bind(this));

Is there any work with the 'this' binding? I'm used to this from the prototype.

+5
source share
1 answer

bind available only in browsers that support ECMAScript 5. Unlike (apparently) Prototype.js, jQuery does not extend built-in objects.

jQuery offers $.proxy [docs] :

$.get(URL + 'dashboard/photoList/'+categoryID, $.proxy(function(o) {
        // code here
},this));
+10
source

All Articles