I'm trying to create an array, assign it to a div-element, push() a value and retrieve it again at a later stage.
Can someone tell me, what I'm missing...:
// set Array
// $(this) is the HTML-element which should get array assigned
var stack = [],
stack.push('#'+$(this).find(':jqmData(role="page")').attr('id')),
$(this).data( stack );
Using
console.log( $(this).data(stack) );
I'm getting back the whole HTML element, while
console.log( $(this).data(stack[0] OR stack.length) );
don't work.
How can I access the elements that I (presumably...) pushed into the array?