So, I have to open my web application, for example a file. Thus, the browser opens the file .html
, and in the adres protocol is used file://
. But on the script, I need to open the file .json
and load it into a variable.
I tried a query $.ajax
with a data type jsonp
, I tried requirejs
who kind of loads the file, but gets a syntax error from the json file, so it does not load into the variable. The same thing happens if I just do it
<script type="text/javascript" src="path/to/.json"></script>
Is there another way? The application does not use PHP, which must be run from the protocol file://
without changing the browser settings.
thanks
source
share