Skip to content
Advertisement

How to access data of uploaded JSON file?

I have a html code like this:

JavaScript

And I have a JSON file like this:

JavaScript

And a simple JavaScript function:

JavaScript

Now I want to call alert_data() with name and family that stored in JSON file which uploaded using my HTML input.

Is there any way to use an HTML5 file reader or something else?
I’m not using server-side programming, all of them are client-side.

Advertisement

Answer

You will need an HTML5 browser, but this is possible.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement