randyk (1) [Avatar] Offline
I just started the book and I am enjoying it. I have minor comment on the code in section 2.6.2. You might want to drop a note explaining how the line "$(ui.draggable).data('id')" works. This appeared to be a little magical to me at least. It wasn't until I drilled down into the jQuery.extend code that I figured out how the "data("id")" was able to return data stored in the data-id attribute. Thanks.
stephan.hochhaus (92) [Avatar] Offline
Re: Comment on 2.6.2
Thank you, I have added this to my list for the next update to chapter 2.
Jay Cheroske (4) [Avatar] Offline
I too found this code confusing, so I put some logging calls in to look at the various objects. What I found was that
was already a jQuery object. Which meant that:


should be able to be replaced with:


with no ill effects. I tested it and my little app still works. What am I missing?
stephan.hochhaus (92) [Avatar] Offline
You are not missing anything - both variants work well. We decided to use the slightly more verbose approach to indicate that we're dealing with jQuery functionality here.
Added a remark in the chapter to be included in the next MEAP update.

Edit After sleeping on it we will use your code instead - it's much shorter and less confusing. Thanks again for bringing it up! It's much appreciated
stephan.hochhaus (92) [Avatar] Offline
Changed in MEAP v8, but it is actually 2.5.2 now.