Loading data from external json file with javascript or jquery -
i'm looking dynamically using data external json file javascript. must have misunderstood how call file because moment can't access data... theres html calling js file. , js file calls json using method :
$(function() { function stocktimeline(){ $.getjson('json/corse_timeline/corse_timeline.json', function(donnees) { $('#wrap').html('<p>' + donnees.timeline.date[4].enddate + '</p><p>' + donnees.timeline.date[9].startdate + '</p><p>' + donnees.timeline.headline + '</p><p>' + donnees.timeline.date[30].headline + '</p><p>'); console.log("this console.log not working"); }); console.log("this console.log working"); } stocktimeline(); });
i've taken method right out of several tutorials i've read. how can test if json file corrupted? because need upload on server work?
you can verify json file pasting json lint.
Comments
Post a Comment