[jQuery] $.data question
[jQuery] $.data question
Hi<div>
</div><div>Sorry if its already been asked</div><div>
</div><div>when i used $.data and pass in ''(empty string), it return me 7. no matter what i have put for ''.</div><div>when i looked at the code i believe 7 was just a generated id from jQuery. and the reason why it always return the id is because of </div>
<div>// Return the named cache data, or the ID for the element</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return name ?</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>jQuery.cache[ id ][ name ] :</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>id; </div><div>
</div><div>because '' is false in this case.</div><div>
</div><div>is this a bug? or is it an expected behavior?</div><div>
</div><div>Thanks</div>