This isn\'t a crucial piece of knowledge for me, but I would still like to know what exactly is happening here.
This is a .NET 3.5 Web Forms application. One of the pag
It's the jQuery expando attribute, it's the key in the jQuery.cache
object that represents that element's data and events collections.
In your example, in that page jQuery.cache["2"]
would give you the same as $("#ctl00_CloseButton").data()
, when you add an event handler or data and the object doesn't already have one, it gets a new expando (jQuery.expando
) attribute with the next number in the sequence as the value.
The reason this is done is primarily for IE, assigning handlers or data objects directly to the element makes the garbage collector behave very poorly, attaching them with this key, but no direct reference link, there's no loop and the garbage collector behaves much better.