expected behavior of multiple binds to same event on the document
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
I curious if I am making a mistake, (well I am but I'm wondering if my mistakes propagation is excepted).<div><br class="webkit-block-placeholder"></div><div>if I do something like:</div><div><br class="webkit-block-placeholder"></div><div>var counter = 0;</div><div><br class="webkit-block-placeholder"></div><div>for(var i=0;i<3;i++){</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>jQuery(document).bind("someCustomEvent.MyNamespace", function(event){</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>console.log(counter++);<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>event.stopPropagation();<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>event.preventDefault();<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>})</div><div>}</div><div><br class="webkit-block-placeholder"></div><div>jQuery(document).trigger("someCustomEvent");</div><div><br class="webkit-block-placeholder"></div><div>------------ console logs ------------------</div><div>0</div><div>1</div><div>2</div><div><br class="webkit-block-placeholder"></div><div>I guess this makes sense because you could be binding unique handlers in each case and would want them all to be fired given the trigger. It's definitely a dumb question because I'm sure I just answered by writing it down!</div><div>
</div><div>Thanks</div><div><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>Chris Thatcher</div><div>(cell) 202 340 9685</div><div><a href="mailto:christopher.thatcher@comcast.net">christopher.thatcher@comcast.net</a></div><div><a href="mailto:chth@loc.gov">chth@loc.gov</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></span> </div>
</div>