When Stackoverflow Sends You in the Wrong Direction (processing file input)
I have a file input element
<input type="file" id="fileid">
How do I call a JavaScript function after selecting a file from the dialog window and closing it?
Yikes! No answer marked right and the most upvoted says :
jQuery("input#fileid").change(function () {
I say : OMG
All you need to do is
<input type="file" onchange="calledFunction()">
FYI, to use the Duke Javascript Library, in your HTML (say in Codepen) :
<script src="http://www.dukelearntoprogram.com/course1/common/js/image/SimpleImage.js">
</script>
What they didn't do a terrific job of covering in the course (or their documentation) : whether SimpleImage objects can be passed to/from functions? Ans : Yes, just do var name_of_var = function_that_returns_SimpleImage(args); // Yes, args can include SimpleImage objects..
Comments
Post a Comment