Discover the best of the web!
Learn more about Digg by taking the tour.
jQuery 1.2: jQuery.extend(”Awesome”)
jquery.com — This is a massive new release of jQuery that ’s been a long time in the making - and it’s ready for your consumption! New features, plugins, and plenty of documentation to soak up.
- 1004 diggs
- digg it
- bmsterling, on 10/10/2007, -1/+16jQuery: little, yellow, different.
Great work, the best just keeps getting better.- spyk3d, on 10/10/2007, -0/+2Indeed it does... maybe now's time to look at migrating from Mootools.
- acidandspatter, on 10/10/2007, -0/+1I came from a Mootools background and jQuery for me is simpler, faster and even easier to use than Mootools.
- elvisjulep, on 10/10/2007, -0/+3Boosted you for the Nuprin reference that only older folks and Wayne's World fanatics will get.
- bmsterling, on 10/10/2007, -0/+2I was starting to think know one would get that!
Stairway to heaven, denied!
- bmsterling, on 10/10/2007, -0/+2I was starting to think know one would get that!
- spyk3d, on 10/10/2007, -0/+2Indeed it does... maybe now's time to look at migrating from Mootools.
- phytar, on 10/10/2007, -2/+44About jQuery: jQuery is a JavaScript Library (a set of useful functionality that you can reuse on your web sites) that makes manipulating a web site easy. It includes functionality for modifying pages, doing animations, and performing Ajax requests. It, also, has a plugin architecture for snapping in new functionality. A good introductory post, for more information: http://simonwillison.net/2007/Aug/15/jquery/
Much more information can be found in the tutorials: http://docs.jquery.com/Tutorials- TastyLamp, on 10/10/2007, -1/+9Digg uses it.
- kingkilr, on 10/10/2007, -0/+2digg also ues prototype.js(prototypejs.org) which is also awesome(I've never used jQuery).
- XxERMxX, on 10/10/2007, -0/+0Thanks for the quick explanation.
- TastyLamp, on 10/10/2007, -1/+9Digg uses it.
- joestump, on 10/10/2007, -0/+13Mmmmm ... I (heart) jQuery.
- sunsean, on 10/10/2007, -1/+9jQuery is my new lightsaber for the web.
- stockjones, on 10/10/2007, -0/+5Wow that was fast after 1.1.4. jQuery and crew are my web hero's
- trib4lmaniac, on 10/10/2007, -0/+3Indeed, only 18 days since the previous release. I am impressed.
- cephelo, on 10/10/2007, -0/+41.1.4 and 1.2 were developed as a package intended for close release dates. 1.1.4 is the transition release between 1.1.2 and 1.2, since features were removed and cleaned up. 1.1.4 supports both syntaxes mostly of some of the items removed in 1.2, so code running 1.1.2 can be upgraded with 1.1.4 in preparation for a migration to 1.2. It was a great, simple transition and the speed ups are awesome.
- trib4lmaniac, on 10/10/2007, -0/+3Indeed, only 18 days since the previous release. I am impressed.
- DanAtkinson, on 10/10/2007, -1/+1Wooooo! Downloading that baby ASAP!
- Dested, on 10/10/2007, -0/+3That new animate stuff looks pretty cool. Saves heaps of time.
- fugazied, on 10/10/2007, -1/+2Great syntax, has xpath too, very exciting JS library!
- codmate, on 10/10/2007, -1/+10How does this compare to ProtoType / Scriptaculous?
http://www.prototypejs.org/
http://script.aculo.us/- Egoist, on 10/10/2007, -0/+24It'll make you say, "Proto-who?"
- dieseltravis, on 10/10/2007, -2/+4and script.aculo.what?
- TastyLamp, on 10/10/2007, -0/+21jQuery is a lot faster.
- saynotocensors, on 10/10/2007, -0/+14It's generally faster and more importantly much much smaller.
Prototype / scriptaculous packed come in at over 100k. JQuery is about 21k
If you serve it gzipped then it's under 10k.
Not guaranteed but it's also my experience that most of the plugins inherit the small file size philosophy too.- NinjaBoy, on 10/10/2007, -3/+177kb actually
- gernblansted, on 10/10/2007, -1/+3That's the unpacked easy to read version. The packed version is about 21k.
- Onestone, on 10/10/2007, -1/+7jQuery is also more convenient. You write shorter, and more understandable code.
- NinjaBoy, on 10/10/2007, -3/+177kb actually
- achoi, on 10/10/2007, -0/+11to many, prototype/scriptaculous is more of a 'I'm a hammer and everything looks like a nail' solution. It's nice in lot of ways, but a lot of times overkill for many user's needs.
Jquery is much lighter, and at first glance the prospect of doing anything functional with it looks like too much work, but once you begin to get your script-fu up, you'll realize how much faster you can code with it. Like poster said above, it really is the lightsaber of web development.- bmsterling, on 10/10/2007, -2/+0well put anchoi!
- RogerH, on 10/10/2007, -0/+25You could do like Digg and use them all at once! I don't think Kevin Rose ever met a JavaScript library he didn't like ;-)
In other news, I need to restart my browser now...- SomaSynth, on 10/10/2007, -2/+3Kevin Rose developed Digg much like Al Gore invented the internet. At least it's in his favor that he can't be blamed for the comment system.
- skyshard, on 10/10/2007, -2/+2what about mootools?
- dustedotnet, on 10/10/2007, -0/+1Been using it since it's original release. ;D
- starkraving, on 10/10/2007, -0/+2I love Mootools... don't get me wrong: JQuery is really good too, and had all the features I like in Moo long before, but somehow the implementation in Moo was easier for me to work with on my own apps. That's just me though, and there's a reason that JQuery is getting the rave reviews that it gets, and they're all well-deserved. You can't go wrong with either Mootools or JQuery.
- Egoist, on 10/10/2007, -0/+24It'll make you say, "Proto-who?"
- fLUx1337, on 10/10/2007, -0/+2Thining of making the move to jQuery, heard alot about it...
/me goes to read- bmsterling, on 10/10/2007, -0/+2jQuery has a great community, so any learning curves are lessened.
- icexe, on 10/10/2007, -0/+4if you have moderate JS esperience, then you should be able to pick up jQuery and run with in in less than an hour. Its THAT easy to learn.
- knowyourrights, on 10/10/2007, -18/+1wtf is jQuery?
- nkm82, on 10/10/2007, -1/+6jQuery is the way that Javascript should be.
- chris9902, on 10/10/2007, -0/+7you know you don't have to comment on every story right?
- Ryosen, on 10/10/2007, -0/+2you know you could just read the explanation that was posted above 7 hours before your post?
- Filipp0, on 10/10/2007, -0/+1The first rule of jQuery is: you do not talk about jQuery.
- biocandy, on 10/10/2007, -7/+1jQuery is brilliant!... a little slow but really useful!
- nlogax, on 10/10/2007, -0/+8Slow? It used to be a bit slow, these days it's definitely not.
- bilangew, on 10/10/2007, -0/+1Slow? Not really, if you use specific selectors. The key is to use FAST selectors, see http://www.learningjquery.com/2006/12/quick-tip-optimizing-dom-traversal for infos.
Also, It seems that the version of autocomplete that I use (forgot the URL) slows down alot if you bind if you 50+ inputboxes. You may have to hack a bit and/or start your own to get some speed optimization.
My two canadians cents, eh.
- Caleb666, on 10/10/2007, -13/+2ExtJS blows jQuery out of the water for any serious web application work.
- tybris, on 10/10/2007, -1/+10Except that it's a completely different thing. If they were smart they would have implemented ExtJS using jQuery.
- akkuma, on 10/10/2007, -0/+2I haven't seen how 1.2 stacks up in speed to ExtJS, but last I saw ExtJS was considerably faster than jQuery. Personally, I've worked with prototype, jQuery, and mootools. ExtJS is not a completely different thing. It is a library that focuses on widgets, but contains many of the same ideas like Element and DomQuery.
On top of this, you can use ExtJS with jQuery, Prototype, or YUI. In fact, you initially needed YUI as it was an extension hence Ext, which then was made compatible with jQuery and Prototype.
- akkuma, on 10/10/2007, -0/+2I haven't seen how 1.2 stacks up in speed to ExtJS, but last I saw ExtJS was considerably faster than jQuery. Personally, I've worked with prototype, jQuery, and mootools. ExtJS is not a completely different thing. It is a library that focuses on widgets, but contains many of the same ideas like Element and DomQuery.
- tybris, on 10/10/2007, -1/+10Except that it's a completely different thing. If they were smart they would have implemented ExtJS using jQuery.
- tybris, on 10/10/2007, -0/+2This could just blow me off GWT. I'm tired of DOM.getChild(DOM.getElementById('')....
- Ryosen, on 10/10/2007, -0/+4$('someId'); // never use getElementById() again
- smoothoperatah, on 10/10/2007, -0/+1unless you dont need to extend the element, and just need to return it. $(id) in most frameworks adds a few more msec to the call because of all the processing it does on the object.
sometimes every msec counts.
- smoothoperatah, on 10/10/2007, -0/+1unless you dont need to extend the element, and just need to return it. $(id) in most frameworks adds a few more msec to the call because of all the processing it does on the object.
- akkuma, on 10/10/2007, -0/+4GWT seems to have been designed for people scared of getting into the real javascript language or want to keep everything contained in one language.
- Ryosen, on 10/10/2007, -0/+4$('someId'); // never use getElementById() again
- stygiansonic, on 10/10/2007, -0/+3Great set of additions. In particular, offset() from the Dimensions plugin should simplify a lot of on-screen layout tasks.
- Degenerate, on 10/10/2007, -1/+2I love jQuery. I just wish their updates weren't so frequent. now i have to test all my plugins for the latest version again before i can implement 1.2. I only tested 2 weeks ago.
- jkramlich, on 10/10/2007, -0/+1*crosses fingers and hopes that v1.2 fixes a bug that prevented v1.1.4 from working with Internet Explorer and the form validatotor plugin.*
- coldskool, on 10/10/2007, -3/+1What the ***** is a form validatotor?
- picsectionpleez, on 10/10/2007, -0/+1It validates and carries it around too. Didn't you get the memo?
- coldskool, on 10/10/2007, -0/+1Yea, but it was on my second monitotor
- picsectionpleez, on 10/10/2007, -0/+1It validates and carries it around too. Didn't you get the memo?
- coldskool, on 10/10/2007, -3/+1What the ***** is a form validatotor?
- MrPanda, on 10/10/2007, -5/+2I know I'll just get flamed as usual, but I have to say imho Mootools is still better, faster, and has superior documentation. Obviously up for debate, but I suggest giving Moo a chance and decide for yourself.
I wish digg would just rule out diggs regarding George Bush, Apple products, and front end coding. They are almost always irrelevant.- aosh, on 10/10/2007, -0/+2What do you mean by "better"? that would give us a lot more material to respond to/learn from.
- MrPanda, on 10/10/2007, -0/+0For example, (and pardon me if jquery added this without my knowledge) Mootools has some nice flourishes like mouseenter and mouseleave events which are usually only available in IE. I used to need to call a separate function when I wanted use custom version of those events, and considering how often you need to use those rather than over and out, well it was alway an annoyance. Helping to soothe those minor but constant javascript annoyances is what I have always liked about Mootools.
I am the first to admit that this is a 2 horse race, scriptcrapulous is pretty much garbage, as are dojo, yahoo, etc...
But Mootools just has all those little touches I require to churn out code for cash.- bmsterling, on 10/10/2007, -0/+1Is there a difference between mouseenter and hover? Or mouseout and mouseleave? Just curious and maybe something I would work on if there is a difference.
thanks.- barveSirRobin, on 11/12/2007, -0/+0Yep, mouseenter and mouseleave are separate events. Therefore you can set something to happen when the mouse enters an element, and somewhere else set another thing to do when it leaves, rather than having to set both at once...
Can I just say one of my main problems with jQuery is that it is not event based enough (or at all). This is a problem with many libraries - they turn what should be events into functions. There are extremely important conceptual difference between events and functions, e.g. that events happen outside of the normal flow of the program. And it prevents us "end developers" - those using the libraries for development - from doing proper event based programming.
Robin.
- barveSirRobin, on 11/12/2007, -0/+0Yep, mouseenter and mouseleave are separate events. Therefore you can set something to happen when the mouse enters an element, and somewhere else set another thing to do when it leaves, rather than having to set both at once...
- phytar, on 10/10/2007, -0/+1jQuery has had .hover() since it's inception - it completely simulates mouseenter/mouseleave on all browsers.
- MrPanda, on 10/10/2007, -0/+0I agree phytar .hover() does seems to be what I was referring to; my mistake in referencing it as a difference.
I do think it would be great to see a breakdown of the actual differences between the 2; although I am not volunteering for the job.
- bmsterling, on 10/10/2007, -0/+1Is there a difference between mouseenter and hover? Or mouseout and mouseleave? Just curious and maybe something I would work on if there is a difference.
- MrPanda, on 10/10/2007, -0/+0For example, (and pardon me if jquery added this without my knowledge) Mootools has some nice flourishes like mouseenter and mouseleave events which are usually only available in IE. I used to need to call a separate function when I wanted use custom version of those events, and considering how often you need to use those rather than over and out, well it was alway an annoyance. Helping to soothe those minor but constant javascript annoyances is what I have always liked about Mootools.
- till, on 10/10/2007, -0/+1I also like pears better than apples.
- coldskool, on 10/10/2007, -0/+3Mootools has the most choppy animations out of them all. Not only that, the users on the Mootools forums are a bunch of elitist pricks.
- picsectionpleez, on 10/10/2007, -0/+0and don't like dogs
- MrPanda, on 10/10/2007, -1/+0I would agree the mootools fourms are filled with elitist pricks, but I don't mind since I am one. The choppy animation comment is completely incorrect, but they may very well not like dogs. I started out using Jquery, but it is buggier and slower than mootools, has more frequent updates, mainly due to the bugs I assume, and does not have many of the features I am looking for. If you like Jquery by all means use Jquery, I only post here because Jquery gets a ton of Digg press and Mootools doesn't, and that seems a shame considering Moo is better. I am in no way trying to convince anyone of anything, just stating an opinion, giving an alternate viewpoint, etc... Personally, I have worked with both extensively, and find Moo superior; it saves me time and makes me money, but get your cheddar however you can.
- coldskool, on 10/10/2007, -0/+1"I would agree the mootools fourms are filled with elitist pricks, but I don't mind since I am one"
Congratulations, you're a dickhead. - MrPanda, on 10/10/2007, -0/+0Well, I'd rather be a dickhead than a ***** coder. Sticks and stones, etc.
When one side of an argument refers to factual information, and the other side can, at best, muster up some weak vulgarity, well, it kind of reinforces my point. I'm pretty sure Jquery is all your simian brain can handle, so I would suggest sticking to it.
- coldskool, on 10/10/2007, -0/+1"I would agree the mootools fourms are filled with elitist pricks, but I don't mind since I am one"
- DOGPARTY, on 10/10/2007, -0/+1MooTools animations are like silk in everything except ***** Firefox, looks like its Mozillas problem not Moo because Safari, Opera, IE6 IE7 are all fine and fast
- aosh, on 10/10/2007, -0/+2What do you mean by "better"? that would give us a lot more material to respond to/learn from.
- shiftt, on 10/10/2007, -0/+4What's the difference between Minified, Packed, and Uncompressed, other than the size?
- aosh, on 10/10/2007, -0/+2just the size & how the source code looks. api & functionality are all the same.
Uncompressed - readable code
Minified & Packed - not human readable code- dustedotnet, on 10/10/2007, -0/+1Unless you're a super human.
- bmsterling, on 10/10/2007, -0/+0This may help: http://www.julienlecomte.net/blog/2007/08/21/gzip-your-minified-javascript-files/
- aosh, on 10/10/2007, -0/+2just the size & how the source code looks. api & functionality are all the same.
- aaronshaf, on 10/10/2007, -5/+4I choose Prototype instead. There, someone had to say it!
- bmsterling, on 10/10/2007, -0/+0And we thank you for your opinion...
- coldskool, on 10/10/2007, -1/+1In Soviet Russia, Prototype chooses you!
- coldskool, on 10/10/2007, -2/+1Just taking a look at the page I see .hasClass() listed under the new section...
They are just getting around to adding this to jQuery? Prototype has had this for a while now. Also, I think .slice() function should have a different name...- bmsterling, on 10/10/2007, -0/+0Just curious, since I have never worked with Prototype, did they have that from the beginning? Or was that an advancement after the initial release?
- coldskool, on 10/10/2007, -2/+1Doesn't matter... point is jQuery is behind the times. Why choose a library that trails?
- phytar, on 10/10/2007, -0/+2Huh? jQuery has had the .is() function for an incredibly long time now. .hasClass() was just added as a convenience for doing .is(".class"). I assume that you didn't actually look at the release notes for 1.2, or the documentation, otherwise you would've seen that.
- coldskool, on 10/10/2007, -2/+1Doesn't matter... point is jQuery is behind the times. Why choose a library that trails?
- scr1msh4w, on 10/10/2007, -0/+3jQuery doesn't need a hasClass function because it's already got something simpler (the "is" method):
if($(this).is(".myclass")) alert("Yup");- coldskool, on 10/10/2007, -0/+1Neat..
- bmsterling, on 10/10/2007, -0/+0Just curious, since I have never worked with Prototype, did they have that from the beginning? Or was that an advancement after the initial release?
- caLt, on 10/10/2007, -0/+3I've tried jQuery on several small projects.. It saved me great time, and the plugins are really cool.
What I'm trying to say is : "Dugg!". - Respec7, on 10/10/2007, -1/+2*****
- aquadoctorbob, on 10/10/2007, -0/+1An excellent metaphor for jQuery, if you ask me.
- dfltr, on 10/10/2007, -1/+2jQuery is badass, and we're big fans of it here at Digg, but it still lacks the more hardcore functionality of Proto. for day to day dom hacking and effects, it's golden, and i'd recommend it to developers looking for a lightweight library that does pretty much every general task you can think of.
for more extensive OO work though, i still need Proto.- DOGPARTY, on 10/10/2007, -2/+2GET BACK TO WORK!
- cjdigg, on 10/10/2007, -0/+2goodbye prototype
