How to use $.ajax to load a local file?
e.g.
- $.ajax({
- url: "../config.json",
- dataType: "json",
- success: function(data) {
- setting(data);
- }
- });
- function setting(data) {
- // come codes used the data
- }
when I put the html and script files on the service, they works. However, if I run the html file in local file system, the ajax request does not work in
firefox and
chrome , but it works in
IE.
I 've saw the API, in the method "ajax" there has a param "isLocal", BUT IT NEEDS A MAP and it doesn't show any example.
how can I get the data from local file?