After pacing the web and lots of forums, I still can not read a JSON file locally.
Can anyone help me ?
Here is my basic file for my tests, and my .json file on the right.
Forgive me if there are many mistakes. I start with Kendo UI
Thank you in advance for your precious help
5 Answers, 1 is accepted
Attached you will find a small sample based on the snippets from the screenshot sent. While running it locally, you will notice that it populates the Scheduler widget with the two events from the JSON file in question. What I have altered in the Scheduler configuration is that I have included the full name of the JSON file (api/products.json) and I have properly mapped the Id field:
Hello and thank you for your support.
I made the changes taking care to copy your method but it doesn't work either.
Also, I tested with your files and it doesn't work either. It's written the same thing in the console. Something like :
Access to XMLHttpRequest at 'file:///C:/Users/r.rousselle/Documents/NetBeansProjects/Agenda/public_html/api/products.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Here are my files attached
The error observed would be present if you try to run the index.html file directly in the browser (by double clicking it). Instead, you will need to host it on a server and open the server address in the browser. I personally use the http-server npm package run such examples. Here you will find a short video of running the sample sent.
Note also, that in order to display the event passed from the JSON, you will need to set the allDaySlot: configuration option of the Scheduler to true: allDaySlot: true. This is needed because the event is configured to be an all day event ("IsAllDay": true).
Hello and thank you for your relevant remark.
I restarted my page from a local URL and it works!
I still have a problem for the moment that your subscribers do not find either at this link:
Still Thank you ;)
As far as I can see in the forum thread in question, you have resolved the issue faced. Should you have any other questions, please do not hesitate to contact us.