Requires: Minimum cross-browser Javascript library

I know some Javascript, but I just realized that I know very little about cross-browser issues. Unpleasant things, such as the this object in event callbacks in IE (as in xhr.onreadystatechange = function () { ... } ), do not apply to the object to which the function applies, but instead to window , which is not entirely useful .

Here's an impressive and comprehensive list of differences here on SO .

Is there a library that covers these annoying cross-browser issues without selling you a whole lifestyle and round corners with slide effects? I know that jQuery is wonderful (and modular, I know, the user interface is suitable as an extra, and I'm sure others are great too), but I'm looking for something meager, closer to the roots. Just do a minimum and eliminate muck. No need to wrap the DOM in sugar.

Update

Thank you all for your suggestions. I am going to take a look at MyLib, microJS, Ender and Sizzle. GWT, being, of course, a cross browser, in my opinion, is not an easy approach, but certainly interesting.

+4
source share
6 answers

jQuery is not modular - it's all or nothing. If you need a solid, cross-browser library that you can crop to the minimum you need, it's hard to get past MyLibrary : http://www.cinsoft.net/mylib.html .

The name "MyLibrary" means that when you download and configure it becomes your library.

It is absolutely durable, fast and extremely modular. You can use only the bits you need and delete something unnecessary.

By the way, many libraries, such as jQuery, are not really a "cross-browser", they are multi-server - they have a limited set of browsers that they support and do not care about everything else. MyLibrary, on the other hand, is written as a true cross-browser. It also provides great shortcuts for feature detection, so you can easily write reliable backup code.

+3
source

What you need?

Just check out microJS and download the libraries you need.

As mentioned, you can use Ender to bind them

+3
source

"Minimal cross-browser Javascript library" + "I'm looking for something lean, closer to the roots"

I immediately thought of MyLib .
You can even create your own version with this online tool .

+3
source

I think you should take a look at Ender Dustian Diaz and Jacob Thornton works on Twitter .

Ender is not a JavaScript library in the traditional sense. So don’t break out and try to replace jQuery or MooTools with Ender ... It just won’t work ... But! you can build a library from Ender that will be. And you have to. right now.

This is because: Ender is an open, powerful, macro-macro API for compiling your own JavaScript library; It completes the application of agnostic, independent modules in a smooth, intuitive and familiar interface, so you don't need to.

+1
source

Well, the problem with this in JavaScript is that it can be a bit confusing for people who are not used to the fact that it always gets a contextual value, or, in other words, it will always point to an object that is in the current context executable code.

In the case of some events, intervals, etc. its absolutely normal that this points to a window, because LOT (possibly too many) properties in JavaScript are attached to the window object.

How for which JS library to use for your work ... Well, if you do not want to use jQuery as a whole, there is always the most important part of it, which handles the selection of objects inside the DOM and is very important for browser compatibility.

He is called Sizzle and can be found here . It does not offer fancy things like jQuery, but it is small and offers an excellent cross-browser way to select material on pages.

0
source

You can watch GWT .. but it also sells you a lifestyle - Java dev environment. But it also leads to a debugger, a proper IDE, a simpler OO, it compiles optimized cross-browser javascript, etc. And you can always mix and match your own JavaScript wherever you see fit.

-1
source

All Articles