Saturday 15 August 2015

php - How to upload JSON file to create Object in Javascript Runtime without changing server side script? -


How to upload JSON files to create objects in Javascript runtime / respond with server side script?

I have found a way to do this

JSON file & gt; & Gt; (Upload via PHP) & gt; & Gt; JavaScript & gt; & Gt; Object in order

But how do I do not want to use php in this way?

JSON FILE & gt; & Gt; & Gt; & Gt; (Upload directly)> gt; & Gt; & Gt; & Gt; JavaScript & gt; & Gt; & Gt; & Gt; Object in Runtime

Thank you.

Update:

I am trying to solve this problem by looking for a new feature like HTML5 local storage, index ADB, webcall, application cache.

Javascript runs on the client side, and your jsio file is on fire server so that you get it from server side script Need to do it through, you can not access server-side files from client-side javascript

If this is a client-side file, you can read it in JavaScript using the File Reader var Reader = New FileReader (); Reader.onload = function () {console.log (this.result); } Reader.readAsText (file)

No comments:

Post a Comment