I\'m creating a timeline using timesheet.js. The data will be input via custom fields in Wordpress. I want to be able to output that php data into the jquery array. Is that poss
It's quite simple to do this, really: just construct the array in php, and echo its json_encoded
value:
var theArray = '.json_encode($array).';';
} ?>
Job done, you now have a JS variable called theArray
, and its value will be an array of arrays, containing all of the data you need to create new Timesheet('timesheet', 2002, 2013, theArray);