Bug Tracker

Modify

Ticket #10016 (closed bug: duplicate)

Opened 3 years ago

Last modified 2 years ago

Cannot retrieve "false-y" values under key names with dashes using jQuery.data method

Reported by: jquery.chrisarts@… Owned by:
Priority: blocker Milestone: 1.6.3
Component: data Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

The latest version of jQuery does not properly store a value such as 0 with the $.data method.

Example:  http://jsfiddle.net/DQLA5/20/

jQuery.data(div, "test-a", 0); //Will now get retrieved as undefined.
jQuery.data(div, "testb", 0); //Works
jQuery.data(div, "test-c", 1); //Works

This appears to work correctly under jQuery 1.5.2 and 1.6.1. The problem affects use of jsTree, which is where it was discovered. Thanks!

Change History

comment:1 Changed 3 years ago by rwaldron

  • Priority changed from undecided to blocker
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to data
  • Milestone changed from None to 1.6.3

Please review here: http://bugs.jquery.com/newticket

REPORTING INSTRUCTIONS

After searching for existing tickets, please use the instructions in How to Report Bugs to fill out the bug reporting form below. Don't forget to link to a working test case, preferably on jsFiddle!

comment:2 Changed 3 years ago by rwaldron

Duplicate of #9917.

comment:3 Changed 3 years ago by dmethvin

#10144 is a duplicate of this ticket.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.