I have a multipage design with jquery mobile. On the first site i call a function with onklick() to fill a global array with values. Now i want to display this values on the second site, but i can’t manage to display them with document.write(array)
Share
To append data to the DOM you first need to select an element to append it to, then in your case iterate through the array, adding each index’s value to the DOM:
Documentation for
document.write: https://developer.mozilla.org/en/document.writeHere is a JSPerf to show the performance difference between some loops: http://jsperf.com/jquery-each-vs-for-loops/2