Ticket #6808 (closed bug: fixed)
|Reported by:||dareed||Owned by:|
Currently doing this:
Or anything that uses data() (such as bind()), causes the expando to be added:
This value is serialized with the object if it is JSON serialized, which can be a problem for the other end of an AJAX call that expects the JSON to be of a specific format.
jQuery.fn.data should use a function added to the object to contain the expando value rather than a direct field. No JSON serializer will serialize a function. There is only a bit more indirection in getting the value, which should be minimal.
Note that this change is in conflict with ticket 6807, which changes data() to set fields directly on regular objects. If that ticket is resolved, this one is not necessary. If that one is not resolved, this is a much smaller and simpler change that can be taken separately.