Friday, January 15th, 2010
jQuery 1.4 is released
<p>The incredibly popular jQuery library has released jQuery 1.4 on a new website that will celebrate 14 days of jQuery.There are a lot of new features, and as usual performance gains are showcased.
- Easy Setter Functions: For a while now, you’ve been able to pass a function into .attr() and the return value of that function is set into the appropriate attribute. This functionalilty has now been extended into all setter methods
- Ajax: A lot of enhancements to the various remoting functions including support for native JSON parsing, etags, request context, and more
- .css and .attr have been improved
- Per property easing on effects
- If you want to ensure that “this” inside a function will be permanently bound to a particular value, you can use jQuery.proxy to return a new function with that scope
- New events: focusin and focusout
And Joe Walker will be really excited to see that dojo.create has made it in! :)
-
-
jQuery("<div />", {
-
id: "foo",
-
css: {
-
height: "50px",
-
width: "50px",
-
color: "blue",
-
backgroundColor: "#ccc"
-
},
-
click: function() {
-
$(this).css("backgroundColor", "red");
-
}
-
}).appendTo("body");
-
Congrats to the jQuery team. I look forward to seeing posts over the next 2 weeks that go into more detail on the new coolness.
Related Content:











Woot! 3 x .html() speed! Rock on jQuery.
The features are nice, but not liking the 70KB minified size.
I’ll be more annoyed if things start bugging on my website, but I’m planning ahead so I’m already annoyed by this:
Param serialization now happens in the PHP/Rails style by default. You can use jQuery.ajaxSettings.traditional = true; to use traditional parameter serialization.
Everyone who uses PHP and Rails should already know how to work around their quirky parameter naming issues. They shouldn’t need extra help, especially at the expense of everyone else.
How hard is this really:
{ 'param[]': val1, 'param[]': val2}And given they’ll have to probably update anyway, to remove the workaround. Now everyone has to review their AJAX code before updating.
I know people will say the work around is simple and I don’t have to upgrade, I can use the 1.3 plugin, I can update the jQuery-1.4.min.js file, etc.
Yeah I can, but I’d rather I didn’t have to. Just so future Rails and PHP programmers can pretend that Rails and PHP have doesn’t have awkward parameter naming limitations.
Addition to above, the new features look cool, and the performance improvements are impressive.
@Deadmeat:
{ 'param[]': val1, 'param[]': val2}
Will just evaluate to
{'param[]': val2}
so that’s not an option.
Sorry I meant:
{'param[]': [val1, val2] }Which from what I remember is what you need to do now. It’s what AJAXing a form used in a PHP page would do now for example.
I’m also already using [] to pass arrays to PHP.
jQuery 1.4 can check if the parameter already has ‘[]‘. If so, it just does not have to emit them.
Ah so it’s been made default only for future PHP and Rails websites. I haven’t tested this yet. I’ve just being going from the details in the linked article.
So basically older PHP and Rails websites will still work after the upgrade, and yet they would have still worked if it was the other way around too.
So jQuery has now inherited a limitation of PHP and Rails as the default. I could understand if there was any technical merit to doing it this way. But I guess it’s just because PHP and Rails are the environments of choice for jQuery developers.
Awesome. I’m upgrading all my dev environments to 1.4 today
Syntax example looks like Mootools
>> And Joe Walker will be really excited to see that dojo.create has made it in! :)
Now jQuery needs dojo.declare().
:)
Some very interesting changes. I in particularly like the improved setter methods, as well as the focusin/out events.
John gave a nice preview of jQuery 1.4 at Yahoo last month in the second half of this talk:
http://developer.yahoo.com/yui/theater/video.php?v=resig-testing
@mmurph211: That was just the first thing I thought. And it does work great in MooTools.
Anyway, congrats for jQuery !
@jhiswin:
use google load api to load jquery… and most users won’t even notice since it’ll go from their cache
LMFAO! jQuery must like mustard, because the really love playing katch-up… Just in case anyone hasn’t been out of their jCave in quite a while, tons of the features in this 1.4 release are features that have been in Mootools/Prototype for YEARS…here are a few that really make me say “Holy guacamole Batman, you JUST figured this out?!?”
Passing Attributes to jQuery(…) – duh, duh, and one more thing, duh.
—
Binding Multiple Event Handlers – see above, and for chr*st sake people you should ALWAYS have been able to pass in multiple props/events/attrs etc via an object in these frameworks, if you couldn’t before they screwed the pooch. Period
—
Controlling a Function’s Context – uh, this actually came from Protoype JS, regardless of this “feature” being in 1.4, you should know that jQuery calls it “.proxy()” because it has always used the now native function context modifying method “.bind()” improperly to set event handlers – so in truth, this is not a feature, it is a work-around for not keeping up to date with javascript, tear ;(
—
Delay an Animation Queue – see Mootools 1.1, circa 2006
—
Check if an Element Has Something – gee, ya think?
—
Oh, but feel free to continue with the “OMG IE7 created tabbed browsing” party…
To jQuery’s credit though, the different easing per property feature is really cool!
@csuwldcat – See http://mootools.net/forge/p/fx_transmorph. You give MooTools fans a bad name with your constant, unprovoked ranting though…You should have a doctor take a look at that…
I’m a bit sad that .require did not make it and that .proxy has no currying, but in the end I’m really really having fun with the new functions :)
@sixtyseconds – Yeah I saw transmorph in the forge, but still need to give props to jQuery because it was based off of their good idea.
Very excited about jquery 1.4, especially the performance enhancements and per property easing.
Excellent thanks
Why is this rag still posting puff pieces on this dubious script? It’s beyond laughable to talk about “improvements to attr”, speed (it’s always been a tortoise) and nonsense like:-
“f you want to ensure that “this” inside a function will be permanently bound to a particular value, you can use jQuery.proxy to return a new function with that scope”
Scope?! What does – this – have to do with scope? The “experts” can’t even speak the language, so they sure as hell can’t lead neophytes anywhere but off a cliff. ;) And how is another “hitch” function supposed to be a breakthrough feature? It’s basic bullshit. And you can bet they have introduced new and exciting memory leaks with that too. ;)
And how is it that these gushing pinheads can’t seem to find the only real browser scripting news that is out there right now? They know what it is, but theyduhwanna write about it. :( Hi Dion and Ben. You have _zero_ credibility as a news source. Zip.