Live data from Hacker News

JQuery 1.7 Released

blog.jquery.com

21–30 of 47 posts

Re: JQuery 1.7 Released

#21
post #7

Earlier quoted context omitted.

The data feature isn't used that frequently, and when it is the best way to use it is by passing an object anyway. So although it's mentioned it is likely to be very uncommon.

I use event data a lot, but I didn’t even realise you could pass a string.

Yeah, for bind and live I was under the impression that only an object would work from the docs.

Re: JQuery 1.7 Released

#23
post #7

Earlier quoted context omitted.

The data feature isn't used that frequently, and when it is the best way to use it is by passing an object anyway. So although it's mentioned it is likely to be very uncommon.

I use event data a lot, but I didn’t even realise you could pass a string.

Haha, well it has always been documented to be an Object but turns out that there are a lot of people who don't read the documentation and pass strings or numbers. So rather than break their code in 1.7 we decided to document the fact that plain types can be used if you're careful.

Re: JQuery 1.7 Released

#25
post #6

Can someone describe to me how these jQuery releases make their way into Rails 3.1 land? Does the maintainer of https://github.com/rails/jquery-rails do an update and then it's up to us Rails users to execute a "bundle update"?

The quickest way to drop it in vendor/assets. Anything there will override any gems. so `//= require jquery` will just find your local copy instead. Shouldn't have to change any requires.

curl http://code.jquery.com/jquery-1.7.js > vendor/assets/javascripts/jquery.js

Re: JQuery 1.7 Released

#26

One thing I don't like about jQuery's evolution is the size. This version weights at 92K minified / 33K gzipped, which for mobile phones is a PITA.

Agreed, and we plan to do something about it. There will be a jQuery blog post coming soon.

Re: JQuery 1.7 Released

#27

One thing I don't like about jQuery's evolution is the size. This version weights at 92K minified / 33K gzipped, which for mobile phones is a PITA.

I've been leaning more and more toward Zepto for mobile. It's still lacking a fair bit of jQuery's functionality, but the basics are there and the syntax is compatible. You lose a lot of IE/older browser support, but if you do some device sniffing and serve jQuery to desktops and Zepto to mobile devices, that's not really an issue.

Re: JQuery 1.7 Released

#29

My favorite part of the release notes: "Despite jQuery.isNaN() being undocumented, several projects on Github were using it. We have contacted them and asked that they use jQuery.isNumeric() or some other solution." This is an excellent reminder of how much things have changed in the last 10 years in our space; a popular tools vendor can go query a massive source code repository and reach out proactively for transiti…

This is one of the reasons why Google killing Code Search is so sad.

Re: JQuery 1.7 Released

#30
post #7
post #3

There is one ambiguous case: If the data argument is a string, you must provide either a selector string or null so that the data isn’t mistaken as a selector. Pass an object for data and you’ll never have to worry about special cases. I'm being picky I know, but wouldn't it just be easier to use something like: $("#div").on("click", { selector: "span", data: "blahblah", handler: function() }); Perhaps it's far too v…

The data feature isn't used that frequently, and when it is the best way to use it is by passing an object anyway. So although it's mentioned it is likely to be very uncommon.

The Create web editing interface uses event data a lot: https://github.com/bergie/create
Post reply on HN