I am customising a plugin that has array (if that is what is it) that holds config items:
var config = {
width: "100%",
height: "100%",
source: 'js/timeline/test.json',
css: 'js/timeline/compiled/css/timeline.css',
js: 'js/timeline/compiled/js/timeline-min.js'
}
What I want to do is take the source:
data and replace it with a variable eg:
var mysource = 'path/to/source.json';
var config = {
width: "100%",
height: "100%",
source: mysource ,
css: 'js/timeline/compiled/css/timeline.css',
js: 'js/timeline/compiled/js/timeline-min.js'
}
But as it above it does not work. Can anyone point me in the right direction? Thanks
EDIT: Added full code as requested
$(function() {
$.getJSON('http://www.mysite.com/json.php',
function(data) {
jsonObject = eval(data);
var eventdata = jsonObject.tlall;
});
}); //END ON LOAD
var config = {
width: "100%",
height: "100%",
source: eventdata,
//source: 'js/timeline/test.json',
//start_at_end: true, //OPTIONAL
//hash_bookmark: true, //OPTIONAL
css: 'js/timeline/compiled/css/timeline.css',
js: 'js/timeline/compiled/js/timeline-min.js'
}