Search code examples
javascriptajaxjavascript-framework

"Thin" JavaScript framework for cross-browser scripting?


Is there a JavaScript framework that focuses on extending JavaScript by levelling the implementation differences? I don't mean a framework that simply provides the same functionality across different browsers, but something that makes non-standard browsers behave as if they were standards-compliant.

Basically I want something that does for JavaScript what ie7.js does for MSIE or what html5shiv does for HTML5 elements. Or the various workarounds for Web Sockets or Canvas.

I guess jQuery and its ilk could do the trick, but I'd prefer something that allows me to write normal, standards-compliant JavaScript as if there were no differences between the browsers.

EDIT: As every other answer seems to point out that, yes, jQuery is JavaScript and, yes, most JavaScript frameworks try to improve cross-browser compability, let me clarify what I mean.

The differences between JavaScript implementations across different browsers don't have much to do with the language itself these days. Apart from a few built-in methods missing in older browsers, the types mostly behave the same, too. But there are still differences, especially between the present status quo (Chrome/Firefox/Safari) and legacy versions of MSIE (i.e. MSIE 7). Most notably, the DOM tends to have less-or-more subtle peculiarities to its API.

I don't want just a framework that lets me write JavaScript that works across most browsers. Those are a dime a dozen. I want a thin layer that allows me to write code that works in modern browsers and legacy browsers alike. jQuery, Dojo, etc all go way beyond that and provide their own unique APIs instead of unifying the existing ones.

Saying "use jQuery" is like saying I should use Rich Ajax Platform (or other code generation frameworks) if I want to avoid cross-browser rendering differences. I don't want a "substitute", I want a "bugfix" (not literally).

EDIT2: Just to drive the point home: I'm not looking for just any framework. I'm deeply familiar with jQuery, have tried YUI and am currently considering to give Dojo a try. I don't simply want a "good" framework. I want one that fits my very specific description. It's okay if there isn't anything like it, though it'd be interesting to know why not (i.e. technical reasons, not "everybody's too busy using jQuery").


Solution

  • A long time has passed since this question was asked, but perhaps it's of use to someone: recently, a group of developers from Financial Times set up sort of a universal polyfill that only patches the necessary parts for different browsers.. http://cdn.polyfill.io/v1/docs/