Why am I getting this error? This should work, what I'm trying to do is when someone selects the form on the upload the image file. Thanks
The error I keep getting is
<html>
<body>
<script type="text/javascript">
function EL(id) { return document.getElementById(id); } // Get el by ID helper function
function readFile() {
if (this.files && this.files[0]) {
var FR= new FileReader();
FR.onload = function(e) {
EL("img").src = e.target.result;
EL("b64").innerHTML = e.target.result;
};
FR.readAsDataURL( this.files[0] );
}
}
EL("inp").addEventListener("change", readFile, false);
</script>
<input id="inp" type='file'>
<p id="b64"></p>
<img id="img">
</body>
</html>
But it was not working fine