Hi
Im fairly new to js and find I need to use the jQuery library. I am struggling to understand this code:
Code:
<script id="source" language="javascript" type="text/javascript">
$(function () {
var datasets = {
"usa": {
label: "USA",
data: [[1988, 483994], [1989, 479060], [1990, 457648], [1991, 401949], [1992, 424705], [1993, 402375], [1994, 377867], [1995, 357382], [1996, 337946], [1997, 336185], [1998, 328611], [1999, 329421], [2000, 342172], [2001, 344932], [2002, 387303], [2003, 440813], [2004, 480451], [2005, 504638], [2006, 528692]]
},
First off, what is the 'datasets' data structure called?
Secondly, is there a way that I can use a function to populate the 'data' array, like so:
Code:
var datasets = {
"usa": {
label: "USA",
data: xmlToArray('WGTPRICE')
},
TIA,
Ed