Saturday, 15 August 2015

javascript load JSON file failed -



javascript load JSON file failed -

i trying load info json file in same folder, here javascript code:

$.getjson('jsonfile.json', function(data){ alert("here"); var = data[0]; });

but when open html in chrome, throws error :

xmlhttprequest cannot load file:///c:/userskkdesktopchartsjsonfile.json. cross origin requests supported http. jquery.min.js:4 o.ajaxtransport.l.cors.a.crossdomain.send jquery.min.js:4 o.extend.ajax jquery.min.js:4 o.each.o.(anonymous function) jquery.min.js:4 o.extend.getjson jquery.min.js:4 (anonymous function) chart.html:28 uncaught networkerror: failed execute 'send' on 'xmlhttprequest': failed load 'file:///c:/userskkdesktopchartsjsonfile.json'. jquery.min.js:4 o.extend.ajax jquery.min.js:4 o.each.o.(anonymous function) jquery.min.js:4 o.extend.getjson jquery.min.js:4 (anonymous function)

which shows fail load json file, knows reason, lot

javascript json

No comments:

Post a Comment