Skip to main content

Bug Tracker

Side navigation

#7209 closed bug (fixed)

Opened October 16, 2010 11:15AM UTC

Closed October 17, 2010 03:43PM UTC

$.fn.removeData can't delete data

Reported by: caii Owned by:
Priority: undecided Milestone: 1.4.4
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:
Description

$('body').data('a',1);

$('body').removeData();

alert($('body').data('a')) still 1

alert($.expando in document.body) still true

Is it bug or my mistake? and jQuery.support.deleteExpando does not exist in 1.4.3

Attachments (0)
Change History (3)

Changed October 16, 2010 01:29PM UTC by jitter comment:1

_comment0: Bug confirmed. It looks like the `jQuery.support.deleteExpando` property (and the according test in `support.js`) got removed by accident. \ \ Commit where the `deleteExpando` property was introduced [http://github.com/jquery/jquery/commit/9195107dbb13ad34ae4e9f7cb1df5d79e4748560 #9195107] (improvement on the previous commit [http://github.com/jquery/jquery/commit/a6f3757d50f8be021505f4f7fa7201199e8b7f2d #a6f3375] \ \ Commit where the functionality was removed [http://github.com/jquery/jquery/commit/141ad3c3e21e7734e67e37b5fb39782fe11b3c18#diff-1 #141ad3c] \ \ [http://jsfiddle.net/jitter/jeHSq/ live-test-case]1287235850106009

Bug confirmed. removeData() fails in 1.4.3 (removeData(name) still works).

It looks like the jQuery.support.deleteExpando property (and the according test in support.js) got removed by accident.

Commit where the deleteExpando property was introduced #9195107 (improvement on the previous commit #a6f3375)

Commit where the functionality was removed #141ad3c

live-test-case

Changed October 16, 2010 02:26PM UTC by addyosmani comment:2

#7210 is a duplicate of this ticket.

Changed October 17, 2010 03:43PM UTC by John Resig comment:3

resolution: → fixed
status: newclosed

We removed deleteExpando after 1.4.2, for some reason. This caused problems with removeData() (no arguments). Fixes #7209.

Changeset: e1b940d74824282fd3466d39a8ab574da4ef6fc5