1

Reset.css files are used to resolve browser inconsistencies when it comes to styling.

Is there something similar for JavaScript inconsistencies across browsers like a reset.js?

For example this "reset.js" library would define a prototype for the String trim() method as specified in this question since (among other things) IE8 does not support this.

I know libraries like jQuery can be used to overcome these inconsistencies but having something like a reset.js could help when using 3rd party JavaScript libraries that do not use jQuery.

Community
  • 1
  • 1
8bitme
  • 897
  • 2
  • 16
  • 24
  • 1
    Not that i know of, however it probably wouldn't be too difficult to create one. Skim through the MDN, it has many of these shims where you could just copy paste them in as needed. – Kevin B Jul 17 '13 at 18:48

2 Answers2

2

Yes, there are polyfills to do exactly that. But there are so many things you'd need to fix that you can't put all fixes in one single script :-)

Have a look at the HTML5 Cross Browser Polyfills list.

If you're specifically interested in EcmaScript compliance, there are ES5 shims to retrofit missing or incorrectly implemented methods like String::trim; yet they can't fix the engine bugs (identifier-keywords, NFEs, …).

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
1

I don't know of one that is/does exactly what you asked in a single library and as far as I know there are quite a lot of people against 'patching' the built in JavaScript objects, and some libraries (e.g. ExtJS) that did this in previous versions have changed and do now deliver the functionality in custom utility functions.

On the other hand there are a ton of smaller and larger shims to bring missing functionality to older browser, especially dealing with HTML5 inconsistencies.

Nic
  • 581
  • 2
  • 11