samples/01_initialization/02_load_json.html not working


I am trying to get to work a gantt chart from a json file. On the samples folder there is just an exact case for what I am looking for: samples/01_initialization/02_load_json.html, however I can not open this file correctly and does not matter if I use firefox or chrome, both can’t open the data.

There is an extra configuration that I have to make??

Firefox console shows:

NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

while chome console shows:
Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. file:///local/master/projects/dhtmlxGantt/dhtmlxGantt_v3.2.1/samples/common/data.json
XMLHttpRequest cannot load file:///local/master/projects/dhtmlxGantt/dhtmlxGantt_v3.2.1/samples/common/data.json. Origin null is not allowed by Access-Control-Allow-Origin. 02_load_json.html:1
Uncaught SyntaxError: Unexpected end of input 02_load_json.html:1

There is something obvious that I am missing??

Thank you,


It seems you are trying to just open file. (For example: file:///E:/gantt/samples/01_initialization/02_load_json.html)

But if you want load data from json file on server you should put your gantt to the server and open correct link (For example: … _json.html)

Thanks!!! :smiley: