js/myaction.js
/*
Populates the image upload popup window with a image preview.

imgFile must be a file object from an <input type='file'> 
NOTE, This function creates a temporary URL reference to the 
img file on the system; the file is never loaded into browser memory 
As such, if you clear cache or move the original file the preview may 
break. But for larger files (~4MB) this is much faster than the 
alternative which needs to parse & recreate the file. */
Populates the image upload popup window with a image preview.
imgFile must be a file object from an 
NOTE, This function creates a temporary URL reference to the
img file on the system; the file is never loaded into browser memory
As such, if you clear cache or move the original file the preview may
break. But for larger files (~4MB) this is much faster than the
alternative which needs to parse & recreate the file.
Populates the image upload popup window with a image preview . imgFile must be a file object from an NOTE This function creates a temporary URL reference to the img file on the system ; the file is never loaded into browser memory As such if you clear cache or move the original file the preview may break . But for larger files ( ~4MB ) this is much faster than the alternative which needs to parse & recreate the file .
function generateImagePreview(imgFile) {
    var imagePreview = document.getElementById("imagePreview");
    imagePreview.hidden = false;
    imagePreview.src = URL.createObjectURL(imgFile);
}
function generateImagePreview ( imgFile ) { var imagePreview = document . getElementById ( "imagePreview" ) ; imagePreview . hidden = false ; imagePreview . src = URL . createObjectURL ( imgFile ) ; }
Populates the image upload popup window with a image preview.
Populates the image upload popup window with a image preview .