Answer the question
In order to leave comments, you need to log in
Is it possible to read json file using jquery?
Is it possible to read a json file with jquery or javascript or ember js on the client side without a raised server?
If so, how?
There is a method in jquery
$.getJSON( "ajax/test.json", function( data ) {
}
Cross origin requests are only supported for protocol schemes
Answer the question
In order to leave comments, you need to log in
If I understand you correctly, here is jquery.getjson
To disable the error:
If the browser is chrome: in chrome it is possible to disable this check by starting the browser with the key
Then local files will be picked up.
And also I advise you to read:
Different protocols are regarded as different resources.
If you need authoritative sources, then you need to read the points from here tools.ietf.org/html/rfc6454 or www.w3.org/Security/wiki/Same_Origin_Policy
With the help of AJAX
, if you are developing locally, then what will then lie on the server - raise the server locally
if you need to read exactly the local file - use FileApi
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question