Answer the question
In order to leave comments, you need to log in
Is it possible to open JSON file via JS without AJAX?
I am making my own js library.
There are files:
Neon-library.js//library file
Neon-configuration.json//configuration
It is necessary to make the library file open the configuration file and read it to configure the library. Write if this is possible and if so, how?
Answer the question
In order to leave comments, you need to log in
It can be ported to the browser with the usual http.
There is a good script tag for this, since the json object is essentially a JS object. Therefore, in the file itself, you need to assign the json object to a global variable.
File:
Browser Porting:
Usage:
<script>
if(fileJSON) console.log(fileJSON);
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question