<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: jQuery.bind() Data</title>
	<atom:link href="http://www.barneyb.com/barneyblog/2009/04/10/jquery-bind-data/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog/2009/04/10/jquery-bind-data/</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Thu, 11 Sep 2014 09:58:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rali Madhu</title>
		<link>https://www.barneyb.com/barneyblog/2009/04/10/jquery-bind-data/comment-page-1/#comment-282208</link>
		<dc:creator>Rali Madhu</dc:creator>
		<pubDate>Fri, 28 Oct 2011 07:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=818#comment-282208</guid>
		<description>It will only be faster for a single bind. If you do multiple delegate will be faster.</description>
		<content:encoded><![CDATA[<p>It will only be faster for a single bind. If you do multiple delegate will be faster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Kahn</title>
		<link>https://www.barneyb.com/barneyblog/2009/04/10/jquery-bind-data/comment-page-1/#comment-202797</link>
		<dc:creator>Thomas Kahn</dc:creator>
		<pubDate>Tue, 19 Jan 2010 13:12:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=818#comment-202797</guid>
		<description>Thanks! This was a very useful article!</description>
		<content:encoded><![CDATA[<p>Thanks! This was a very useful article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mamoon ur Rasheed</title>
		<link>https://www.barneyb.com/barneyblog/2009/04/10/jquery-bind-data/comment-page-1/#comment-190701</link>
		<dc:creator>Mamoon ur Rasheed</dc:creator>
		<pubDate>Wed, 09 Sep 2009 07:34:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=818#comment-190701</guid>
		<description>Thanks man, i was looking for this and it solved my problem</description>
		<content:encoded><![CDATA[<p>Thanks man, i was looking for this and it solved my problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jozero</title>
		<link>https://www.barneyb.com/barneyblog/2009/04/10/jquery-bind-data/comment-page-1/#comment-175808</link>
		<dc:creator>Jozero</dc:creator>
		<pubDate>Thu, 30 Apr 2009 19:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=818#comment-175808</guid>
		<description>Wow. Thanks ! Stumbling upon your site help solved something I&#039;ve been stuck on for a while. If you are binding an event dynamically in a loop to serial DOM elements, you can&#039;t just access the index counter within each bind event and get the right index, all it does is get the last index. However your binding data to that bind event solved that issue.

For example if you do this :
&lt;pre&gt;
$(&quot;.m&quot;+count).bind(&#039;dragstop&#039;,  function(ev, ui, counter) { 
  console.log (counter);
}
&lt;/pre&gt;

Each time you drag an item, say .m1 or .m2, counter will only return the last value counter was - so its impossible to tie values back to what you are dragging. 

If you do this though thanks to your page :
&lt;pre&gt;
$(&quot;.m&quot;+count).bind(&#039;dragstop&#039;, {counter : count},  function(ev, ui) {
 console.log (ev.data.counter);
}
&lt;/pre&gt;
It has the correct value. That is if you drag around .m1 it returns 1, .m2 returns 2, etc.</description>
		<content:encoded><![CDATA[<p>Wow. Thanks ! Stumbling upon your site help solved something I've been stuck on for a while. If you are binding an event dynamically in a loop to serial DOM elements, you can't just access the index counter within each bind event and get the right index, all it does is get the last index. However your binding data to that bind event solved that issue.</p>
<p>For example if you do this :</p>
<pre>
$(".m"+count).bind('dragstop',  function(ev, ui, counter) {
  console.log (counter);
}
</pre>
<p>Each time you drag an item, say .m1 or .m2, counter will only return the last value counter was &#8211; so its impossible to tie values back to what you are dragging. </p>
<p>If you do this though thanks to your page :</p>
<pre>
$(".m"+count).bind('dragstop', {counter : count},  function(ev, ui) {
 console.log (ev.data.counter);
}
</pre>
<p>It has the correct value. That is if you drag around .m1 it returns 1, .m2 returns 2, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas</title>
		<link>https://www.barneyb.com/barneyblog/2009/04/10/jquery-bind-data/comment-page-1/#comment-173607</link>
		<dc:creator>Tomas</dc:creator>
		<pubDate>Fri, 17 Apr 2009 19:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=818#comment-173607</guid>
		<description>Thanks a lot! You taught me something new and possibly very useful in my near programming future.</description>
		<content:encoded><![CDATA[<p>Thanks a lot! You taught me something new and possibly very useful in my near programming future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>https://www.barneyb.com/barneyblog/2009/04/10/jquery-bind-data/comment-page-1/#comment-172323</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Fri, 10 Apr 2009 17:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=818#comment-172323</guid>
		<description>Thanks for the insight.</description>
		<content:encoded><![CDATA[<p>Thanks for the insight.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
