bind() and older browsers
- 14 February, 2012 -
- Uncategorized -
- Tags :
- 0 Comments
Had this error today from IE7 & 8 from a script that I got given to fix.
SCRIPT438: Object doesn’t support property or method ‘bind’
I have never come across bind() before, I discovered it was part of the ECMAScript 5 specification, and is only supported by newer browsers (IE9+, FF 4.0, Chrome 7.0, Opera 11.60) it not supported in earlier browser or in Safari.
I found the solution on MDN. It appears the bind() is a new property that overrides the ‘this‘ keyword in a function. A bit of copy and pasta of some code on MDN into my own script, and I had bind working again.