HTML5 File Reader & jQuery: How to log a file's contents to the console
<p>I'm trying to read a text file and print its contents to the console using jquery and the HTML5 file reader. (will try to phrase it later but that's going to be another problem) to load some UI presets. But cant figure out HTML5 reader for the life of me.</p>

<p>Can someone tell me whats the problem with this code?</p>

<pre><code>$('#fileInput').change(function() {

var file = fileInput;
var reader = new FileReader();

reader.onload = function(e) {
fileContent = reader.result;
}

reader.readAsText(file);    

console.log(fileContent);
 });
</code></pre>

<p><a href="https://jsfiddle.net/xLtgcg4m/" rel="nofollow">https://jsfiddle.net/xLtgcg4m/</a></p>