JQuery.ish - A Simpler jQuery
github.com
github.com
I can write off that idea then.
But you could load Zepto if the browser supports it, and otherwise load jQuery because their API is the same.
(function() {
var src = (document.querySelector) ? '//zeptojs.com/zepto.min.js' : '//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js';
document.write('<script src="' + src + '"><\/script>');
})();
This will load Zepto if the browser supports it, and jQuery otherwise.It's already at 483 bytes. Where do you go from here?
Looks pretty "crossbrowser" to me. Seems to be supported on many mobile browsers too based on that link.
The only possible issue I see here is IE < 8 but then again, I'm not sure I'd want to bother with IE6/7 support.
If we're talking about the en vogue subset of browsers, then QSA has support. If we're talking about a set of browsers where a usable DOM implementation is provided (most dating back to Netscape), then, no, support is not provided.
"Works in all browsers" should be closer to the latter, not the former.