Skip to main content

Bug Tracker

Side navigation

#6304 closed bug (fixed)

Opened March 18, 2010 04:19AM UTC

Closed September 24, 2010 08:31PM UTC

calling $(...).data() changes behaviour of $(...).data('nosuchkey')

Reported by: tgdavies2 Owned by:
Priority: undecided Milestone: 1.4.3
Component: data Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:

If you call'foo') you get a result of null, but if you then call followed by'foo') the result is undefined:



<script type="text/javascript" src=""></script>

<script type="text/javascript">

$(document).ready(function() {

$("#firstvalue").html(typeof $("#foo").data('bar'));

var ignored = $("#foo").data();

$("#secondvalue").html(typeof $("#foo").data('bar'));





<div id="foo">Div named foo</div>

<div>First value of $("#foo").data('bar'):<span id="firstvalue"/></div>

<div>Second value of $("#foo").data('bar'):<span id="secondvalue"/></div>



Attachments (0)
Change History (1)

Changed September 24, 2010 08:31PM UTC by john comment:1

priority: → undecided
resolution: → fixed
status: newclosed

I wasn't able to replicate this (namely the result of null) so I think this is fixed on our end. I added some extra tests: