Loading multiple JSON files.
Loading multiple JSON files.
damaya1982
Posts: 12Questions: 0Answers: 0
I have a folder on my web server with multiple JSON files that I would like to load into my Datatable. The files are all in the same format. I am currently doing this:
"bProcessing": true,
"sAjaxSource": "servers/test.json",
And it works. What I'd like to do is something like: "sAjaxSource": "servers/*", so that it loads all the files. Is this possible?
"bProcessing": true,
"sAjaxSource": "servers/test.json",
And it works. What I'd like to do is something like: "sAjaxSource": "servers/*", so that it loads all the files. Is this possible?
This discussion has been closed.
Replies
Its not possible since the Javascript doesn't have access to your server's file system (I'm shivering just at the thought of that - omg!).
As aaronw says, you would need to tell the client-side what files are on the server (if you've got bash that would do. What system are you running it on a Linux / Busybox one?). The other option is to just hard code the file names and use your own Ajax to load them one by one (which you would need to do even if you had the file names).
Allan