鍍金池/ 問答/Linux  HTML/ 用image標(biāo)簽獲取的image的cententLength怎么拿?

用image標(biāo)簽獲取的image的cententLength怎么拿?

用image標(biāo)簽獲取的image的response header 的cententLength怎么拿?

回答
編輯回答
司令

圖片描述

2017年11月30日 06:56
編輯回答
萌小萌

let img= new Image;
img.src="xxx.png";
然后用igm.onload去拿

2018年3月4日 02:33
編輯回答
骨殘心

用image標(biāo)簽?zāi)貌坏?/p>

2017年5月2日 04:55
編輯回答
墻頭草

獲取image標(biāo)簽的src 發(fā)起一個ajax的get請求 然后從contentLength里拿

2017年2月5日 16:46
編輯回答
安若晴
  var img = new Image();
  img.src = "";
  img.onload = function(){
     alert(img.width);
     alert(img.height);
  }
2017年3月10日 01:13