我正在尝试读取nexus7 2013设备的宽度和高度,使用fallowing js代码:
while (!(width && height)){
// alert("if this msg shows more then once - the height or width has been falsly read as 0");
width = e.clientWidth || g.clientWidth || w.innerWidth;
height = e.c
var targetSize = Math.max($(window).width(), $(window).height());
var canvas = $("#canvas")[0];
canvas.setAttribute('width', $(window).width());
canvas.setAttribute('height', $(window).height());
var context = canvas.getContext("2d");
var img = new Image(); // Crea