6
I’m developing a simple static website with html, css, and javascript hosted in Dropbox, using javascript with framework Jquery and trying to read a JSON file.
var jqxhr = $.getJSON( "example.json", function() {
console.log( "success" );
});
I researched about and realized that this is an AJAX call to a local resource through an HTTP request, and that it would only be possible if the site was hosted on a server. Is there any other way to do this? Why does that happen?
The site is hosted on Dropbox, so you have a server. JSON is also in Dropbox, right?
– Bruno César
It is that Dropbox is limited only to client-side scripts and HTML, it is not able to run things from the server-side, rather the JSON file is bundled with html, css and javascript.
– André N. Darcie