HTML5 Data Bindings Support Product Page
Solved
Does not load local json file
Reported 16 Feb 2014 03:47:49
1
has this problem
16 Feb 2014 03:47:49 dsa dggd posted:
nothing shows. Replies
Replied 17 Feb 2014 10:13:20
17 Feb 2014 10:13:20 Teodor Kuduschiev replied:
Please read the following article:
www.dmxzone.com/go/18645/getting-the-best-dmxzone-support
www.dmxzone.com/go/18645/getting-the-best-dmxzone-support
Replied 19 Feb 2014 11:24:41
19 Feb 2014 11:24:41 dsa dggd replied:
thank you for fast reply, wrote to the online support.
Replied 19 Feb 2014 11:27:05
19 Feb 2014 11:27:05 dsa dggd replied:
Detalize my problem here also:
I am binding a local json file to the mobile app page in Dw through your data binding extention, then try to insert the data from json file to the page, but nothing shows in Dw, when I open this page in Chrome browser, I get 2 errors in developer instruments console:
Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. file:///D:/app/dmxDatabaseSources/local.js?callback=jQuery1102002375831757672131_1392808169697&_=1392808169698
XMLHttpRequest cannot load file:///D:/app/dmxDatabaseSources/local.js?callback=jQuery1102002375831757672131_1392808169697&_=1392808169698. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
How can I make it work? I heard that browsers don't allow local files access at all. How then this function is planning to work? Or is it only working in phonegap environment? Then how is it possible to debug the page on desktop?
I am binding a local json file to the mobile app page in Dw through your data binding extention, then try to insert the data from json file to the page, but nothing shows in Dw, when I open this page in Chrome browser, I get 2 errors in developer instruments console:
Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. file:///D:/app/dmxDatabaseSources/local.js?callback=jQuery1102002375831757672131_1392808169697&_=1392808169698
XMLHttpRequest cannot load file:///D:/app/dmxDatabaseSources/local.js?callback=jQuery1102002375831757672131_1392808169697&_=1392808169698. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
How can I make it work? I heard that browsers don't allow local files access at all. How then this function is planning to work? Or is it only working in phonegap environment? Then how is it possible to debug the page on desktop?
Replied 19 Feb 2014 11:44:47
19 Feb 2014 11:44:47 dsa dggd replied:
online support explained me the situation. I should launch and debug the page under webserver running and local json file should work after phonegap buiding the app. Going to try it.
Replied 21 Feb 2014 00:58:49
21 Feb 2014 00:58:49 dsa dggd replied:
After two talks to the support person (I should say that support person is really good and helped a lot with great attention to all questions - thanks a lot, it was really a pleasure to talk to him) I figured out that to make local json file work it is needed:
1) to debug the page not in DW's debug in the browser, but under a loсal webserver, noting also that IIS and nginx don't have json mime type support by default and you have to add it in the config, Apache is ok by default.
2) and you have to change in the DmxDataSet part of code in the head of the page the dataType field from "jsonp" (which is inserted there automatically) to just "json".
After it everything worked fine. Write it in detail in case anyone else have this problem.
1) to debug the page not in DW's debug in the browser, but under a loсal webserver, noting also that IIS and nginx don't have json mime type support by default and you have to add it in the config, Apache is ok by default.
2) and you have to change in the DmxDataSet part of code in the head of the page the dataType field from "jsonp" (which is inserted there automatically) to just "json".
After it everything worked fine. Write it in detail in case anyone else have this problem.