5

In IE I am getting this error in the console using JQuery:

SCRIPT438: Object doesn't support property or method 'bind' default.js, line 33 character 3

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

Is there a work around to binding 'this'? I'm used to this from prototype.

1 Answer 1

10

bind is only available in browsers supporting 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));
1
  • Wow it would have taken me FOREVER to find this out, thanks! LOL
    – JREAM
    Jul 6, 2011 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.