var _URL = window.URL || window.webkitURL;
var $file = FS.gID('failImage');
var imgSize = FS.gID('failImage');
var file, img, imgWidth, imgHeight;
if(file = imgSize.files[0]) {
img = new Image();
img.onload = function() {
imgWidth = this.width;
imgHeight = this.height;
}
img.src = _URL.createObjectURL(file);
}
alert(imgWidth); //Comes out undefined.
Why can't I get this variable to alert the imgWidth? note that I didn't set the var inside the child function and yet in the parent function when I go to alert the imgWidth it comes back undefined?