Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13145 closed bug (notabug)

$.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
  1. 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

Change History (4)

comment:1 Changed 7 years ago by anonymous

$('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

comment:2 Changed 7 years ago by anonymous

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

comment:3 Changed 7 years ago by dmethvin

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

comment:4 Changed 7 years ago by Alex

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?

Note: See TracTickets for help on using tickets.