Search code examples
javascriptjavascript-1.8

Is there a library that creates JavaScript 1.8 compatability in all browsers?


Looking through the Mozilla JavaScript site, I see that JavaScript 1.8 has a lot of great functions. In most cases it has code you can add to extend prototypes of the basic types in the case that the function is not implemented on the user's browser. Is there a library that you can use to add all those functions and therefore use JavaScript 1.8 freely in your code?


Solution

  • You are probably looking for a shim.
    Check out the es5-shim: https://github.com/kriskowal/es5-shim/

    Modernizr has a pretty exhaustive list (wiki) of alternative polyfills or shims (look under ECMAScript 5 for your needs): https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills

    Also, not all features can be provided by shims or polyfills. You could start an issue (remember to search and read the README first) for a feature that you want but isn't provided and the developer might tell you if it's not possible.