Skip to main content

Bug Tracker

Side navigation

#13145 closed bug (notabug)

Opened January 02, 2013 10:26PM UTC

Closed January 03, 2013 03:34PM UTC

Last modified January 03, 2013 03:44PM UTC

$.data issues

Reported by: Alex Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:
Description

i use FF 17.0.1 and Firebug 1.11.1 and jquery-1.8.3.min.js

1. this line "jQuery.data('body', 'page', 10);" throws exception like "TypeError: l[c] is undefined" in the jquery-1.8.3.min.js

2. i have this code

$('body').data('page', 10);

$('body').data('page.en-US.html', 20);

var val = $('body').data('page.e'); // val = 10

debugger shows me result for the expression $('body').data()

Object { page=10, page.enUS.html=20 }

--- Why enUS but not en-US?

--- Why val is 10 but not undefined?

Thanks

Alex

Attachments (0)
Change History (4)

Changed January 03, 2013 11:29AM UTC by anonymous comment:1

$('body').data('page', 10); $('body').data('page.en-US.html', 20); var val = $('body').data('page.e'); val = 10

should be

$('body').data('page', 10); $('body').data('page.en-US.html', 20); var val = $('body').data('page.e'); // val = 10

Changed January 03, 2013 11:32AM UTC by anonymous comment:2

aaaaaaaaaaaa

i commented val = 10 with double slash / but slashes disappear

Changed January 03, 2013 03:34PM UTC by dmethvin comment:3

resolution: → notabug
status: newclosed

On the disappearing dash, see rule 5 here: http://www.learningjquery.com/2011/09/using-jquerys-data-apis

On the strange interpretation of names with dots, that undocumented behavior is being removed in 1.9, see here: http://jquery.com/upgrade-guide/1.9/#events-not-fired-by-the-data-method-names-with-periods

Changed January 03, 2013 03:44PM UTC by Alex comment:4

Hey.. er, I didn't open this issue, I know it says I did.. Didn't even realize I had an account on this trac till I got these mails.

Could someone have just put my mail address in here (one that I don't really use TBH) as an anon?