我不确定这个表达的含义:
var Ajax = Ajax || {};
我认为如果不存在它会创建一个新对象,但我不确定
答案 0 :(得分:0)
如果Ajax
尚不存在,它会将Ajax
分配给Ajax
,否则createCanvas(){
this.imgCanvas = document.createElement("canvas");
this.imgCtx = this.imgCanvas.getContext("2d");
this.imgCanvas.width = this.croppa.imgData.width;
this.imgCanvas.height = this.croppa.imgData.height;
this.imgCtx.drawImage(this.croppa.img, 0, 0, this.croppa.imgData.width, this.croppa.imgData.height);
},
会保留其值。