- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
My json file is 'www/js/test.json' so it is same folder with app.js
My codes in app.js simple get json method my code bellow;
window.kelDb = ""; $.getJSON('test.json',function(jData){ window.kelDb = jData; }); var kDb = window.kelDb; alert(kDb.simple.tree);
How can I do access in www folder any file type ?
Thank you for interest.
Good works..
- Tags:
- HTML5
- Intel® XDK
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The method that you are using is intended to load JSON-encoded data from a server using a GET HTTP request as stated here. You are not able to load local file with that method. By design, standard JavaScript is not allowed to access or operate on a file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I load local json file to associated javascript varriable ? Is this possible ?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You'll need to use the File plugin to access the file. See the Cordova core plugins in the plugin manager on the projects tab.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page