new Image() var img=new Image(); img.src="xxx"; 获取img.width和img.height的值都为0,后来发现它的宽和高需要在img.onload图片加载完全后才能得到。