Re:JQuery 1.5.1 released, includes full IE 9 support
by albertsun on Thursday February 24, 2011 @07:10PM
(#2260427)
On the other hand... congrats! Now you know more about the inner-workings of jQuery and are a better javascript programmer.
Re:JQuery 1.5.1 released, includes full IE 9 support
by abp on Friday February 25, 2011 @03:50AM
(#2261568)
Question is for how long. I've written several thousand lines of native, cross-browser javascript some years ago and from time to time again. But i don't remember a lot of the workarounds, from the top of my head.
Fiddling with cross-browser support is something that my brain don't like to keep today, be it js or css. Things like jQuery for js and compass for css come in handy to brush over that. :)
Re:JQuery 1.5.1 released, includes full IE 9 support
by JonnieCache on Friday February 25, 2011 @06:17AM
(#2261821)
Remember that jQuery's selectors can be used separately: they're a wrapper around the Sizzle library. It's 5kb after minification and gzip.
Can't speak to the performance relative to JQuery or to raw javascript however.
Re:JQuery 1.5.1 released, includes full IE 9 support
by dualogy on Thursday February 24, 2011 @11:10PM
(#2261029)
jQuery too much overhead? What kind of environment was that?
Re:JQuery 1.5.1 released, includes full IE 9 support
by bzbarsky on Friday February 25, 2011 @12:43AM
(#2261211)
Pretty much any environment where you care about performance of your code, actually. A lot of the simple-looking jquery stuff is implemented with tons of indirection, branching, etc.
Just compare the work a browser has to do for something like:
document.getElementById("foo").setAttribute("bar", "baz");
to the work needed for the jquery equivalent...Now the good thing is that most consumers of jquery don't care about performance of their code (in that they're doing small enough amounts of stuff it doesn't matter much).
Re:JQuery 1.5.1 released, includes full IE 9 support
by rimantas on Friday February 25, 2011 @04:35AM
(#2261655)
> Now the good thing is that most consumers of jquery don't
> care about performance of their code
Many do, but more do care about cross-browser compatibility and when you need to support IE6,7 home-rolled code is not likely to cut all the research and effort that's embedded in jQuery.
Re:JQuery 1.5.1 released, includes full IE 9 support
by rorrr on Friday February 25, 2011 @02:24AM
(#2261380)
Out of curiousity I tested that particular statement, and you're right. Compared to
$('#foo').attr('bar', 'baz');
your code is30 times faster in Chrome 9
81 times faster in Firefox 3.6
Re:JQuery 1.5.1 released, includes full IE 9 support
by mazuhl on Friday February 25, 2011 @10:13AM
(#2262395)
47 times faster in Firefox 3.6.1
7 times faster in IE 8
Re:JQuery 1.5.1 released, includes full IE 9 support
by ams6110 on Friday February 25, 2011 @10:04AM
(#2262366)
In most cases, though, using jquery to do something like adding a class, or setting a value, is still plenty fast enough. We're talking about code that runs in the browser, where things move on human timescales. Don't optimize prematurely.
Re:JQuery 1.5.1 released, includes full IE 9 support
by bzbarsky on Sunday February 27, 2011 @11:21PM
(#2270022)
The problems start when you add a class to 10,000 elements on the page. And yes, I've seen pages doing this with jquery where the jquery overhead was what made the difference between a 20ms operation (not user-perceptible) and a 1s operation (very much user-perceptible).
Re:JQuery 1.5.1 released, includes full IE 9 support
by tropin on Friday February 25, 2011 @06:12AM
(#2261812)
Could you share your test code?
Re:JQuery 1.5.1 released, includes full IE 9 support
by bradgessler on Friday February 25, 2011 @03:11AM
(#2261470)
Bookmarklets
So thanks John Resig and the rest of the jQuery dev team for making us web dev guys more productive and actually making JavaScript fun.