Import data-* from local HTML file

Import data-* from local HTML file

Hello

I developped during my spare time a FanSite.

I want to add a Profiling functionality, using Save and Load buttons. Load button is an <input type=file />.

Save button produce a simplified report into a blank page so user can right-clik > Save As... into his local drive. This file so contains all pertinent data-* attribute user used. Note nothing goes to the server, everything is client-side.

Now my problem is how to implement the method $("#LoadButton").change() so it stores back all the html content from this file, into a variable or a hidden div (so i can treat it with .data() later on)

I've seen some snippets about FilReader and FormData... but none worked...

How should i proceed ?