For licensing reasons I cannot host my files on a webserver. I need to serve my website locally.
I have several .json files that I am loading in my JavaScript like this
var jsoncontent = (function () {
let json = null;
$.ajax({
'async': false,
'global': false,
'url': "data/content.json",
'dataType': "json",
'success': function (data) {
json = data;
}
});
return json;
chrome gives me a an error
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
some searching explained to me that this is a good security measure and that just hosting it online will fix it. I cannot do this however for legal reasons.
do I need to stuff all the data into the javascript? Do I need to put everything in the same directory? I'd like to keep my files organized and avoid both, if possible. I don't want users to be required to turn of that security feature, so that is of the table. Also having them run a local server is crazy.
hints would be greatly appreciated.
I want the user to be able download a .zip extract it and just doubleclick on index.html to run the thing.