Skip to main content

Bug Tracker

Side navigation

#6308 closed bug (duplicate)

Opened March 18, 2010 01:21PM UTC

Closed March 19, 2010 03:11AM UTC

.data() inconsistent return value

Reported by: Screeze Owned by:
Priority: Milestone: 1.4.3
Component: data Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

The .data() function returns inconsistent values:

If you try to load a not-existing-value of an object, which does not have ANY values stored, it will return null.

But if this object has ANY value stored in it, and you load the not-existing-value, it returns "undefined".

Example:


<div id="div1">test</div>

<script type="text/javascript">

console.log($("#div1").data("test")); -> result: null

$("#div1").data("abcdefg", 1);

console.log($("#div1").data("test")); -> result: 'undefined'

</script>


That's not what it should be like, is it?

Attachments (0)
Change History (1)

Changed March 19, 2010 03:11AM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

Duplicate of #6304.