Hello every expert and student like me. If I want to upload a local JSON file to the HTML and print it out, is there any way to do it?
The following is what is in the JSON file
{
"Result" : [
{"title":"JSON", "url":"http://json.org",
"description":"the home page for JavaScript Object
Notation"},
{"title":"XML", "url":"http://xml.org",
"description":"the home page for Extensible Markup Language"}
]
}
And these lines are my code for uploading a file.
<form action="/action_page.php">
Upload a file:
<input type="file" id="uploadedFile" name="uploadedFile[]" />
These lines of code give me a button to upload a file, and I want to print the element out like the following.
I want to print the JSON file out, and by doing that I tried to use for loop, but I don't know which part of the code is referencing the uploaded file so I can start writing my for loop? (Or maybe it is not even existed in my written code.) Can I do this?
var myJSON_object = input;
to use myJSON_object as the reference to the input JSON file? Also, a great appreciation for a better way of printing the JSON file out.