I want to be able to use an object's member variables:
function Upload(file, filename, id){
this.file=file
this.filename=filename
this.id=id;
};
Upload.prototype.displayImage = function(btn){
$.canvasResize(file,
{
width: 160,
height: 0,
crop: false,
quality: 100,
callback: function (data)
{
$('#'+btn).css("background", "url("+data+")")
}
});
};
I access the object and method like this:
var upload = new Upload(frontPic, frontPicName, id);
upload.displayImage("btnFrontUploadShow");
However I am getting the error:
ReferenceError: file is not defined
$.canvasResize(file,
Why can't I use the file
variable in the displayImage method, and how can I declare displayImage so that the file
variable is available for use?