Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML5 data, arrays and .push - weird conflict
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COCongratulations to you, @thenewseattle, for the least helpful and most judgemental answer I've ever gotten on Stack Overflow. A few points of clarification: 1 - This is not a homework assignment. I'm seeing bizarre behavior when I assign a value using jQuery's .data() method. I can't find any documentation from jQuery or elsewhere that explains why a child object would get a data value assigned to its parent. 2 - I've provided a jsfiddle that clearly and cleanly reproduces the error. At no point in that javascript is a value assigned to #child1, but it gets a value anyway.
      singulars
    2. COBecause in the real situation, the data is loaded from a Rails backend and written and read by numerous different scripts. It can be updated by a number of different sources (including Faye), so it's acting as a variable storage that is attached to a specific object on in the DOM, objects which get created and destroyed frequently. Using the HTML5 data-* attributes for initial variable load and then updating them seems to be the right method.
      singulars
    3. COThat isn't relevant here. Unless you can explain why using jQuery's `.parent().data()` methods assigns values to not only a parent object but all child objects, I don't think you can help me. I'll just find another way to do this.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload