Test A
Items Tested:
<meta charset="UTF-8" >
<meta name= "Viewport" content= "initial-scale=0.5 user-scalable=no" />
<meta http-equiv= "Content-type" Content= "text/html; charset=utf-8"/>
<title>smadunit</title>
<body style= "margin:0px auto; padding:0; overflow:hidden; background-color:transparent;" ><p>
<a href="http://appsrv1.madserving.com/cli2/ Lgkrp9de65881hl5rl30066fjiv46q6881bqupb25bee2ec. MzY5MDQxMg.c46ab76d2859.ODY2Mjc4MDE. ody2mjc4mdeznjkwndey...-1-1hlx5d/napi1.0.0000/90042385">src="/http Ws-cdn.tangmobile.com/2009/smartmad2/20/52/25bee2ec.jpg" /></a></p>
</body>
<script Type= "Text/javascript">
function Loadimagefinish () {
Console.log (' document.body.clientWidth ' + document.body.clientWidth);
Console.log (' document.body.clientHeight ' + document.body.clientHeight);
Console.log (' window.screen.height ' + window.screen.height);
Console.log (' window.screen.width ' + window.screen.width);
Console.log (' window.screen.availHeight ' + window.screen.availHeight);
Console.log (' window.screen.availWidth ' + window.screen.availWidth);
Console.log (' window.innerwidth ' + window.innerwidth);
Console.log (' window.innerheight ' + window.innerheight);
Console.log (' window.outerwidth ' + window.outerwidth);
Console.log (' window.outerheight ' + window.outerheight);
Console.log (' window.screenleft ' + window.screenleft);
Console.log (' window.screentop ' + window.screentop);
Console.log (' window.screeny ' + window.screeny);
Console.log (' Window.screenx ' + Window.screenx);
}
var = window.setinterval (Loadimagefinish, Timerid);
</script>
WebView set to 300*280
Test equipment IPad
This is debug using Safair:
Test Two
Items Tested:
<meta charset="UTF-8" >
<meta name= "Viewport" content= "Width=device-width, user-scalable=no">
<meta http-equiv= "Content-type" Content= "text/html; charset=utf-8"/>
<title>smadunit</title>
<body style= "margin:0px auto; padding:0; overflow:hidden; background-color:transparent;" ><p>
<a href="http://appsrv1.madserving.com/cli2/ Lgkrp9de65881hl5rl30066fjiv46q6881bqupb25bee2ec. MzY5MDQxMg.c46ab76d2859.ODY2Mjc4MDE. ody2mjc4mdeznjkwndey...-1-1hlx5d/napi1.0.0000/90042385">src="/http Ws-cdn.tangmobile.com/2009/smartmad2/20/52/25bee2ec.jpg" /></a></p>
</body>
<script Type= "Text/javascript">
function Loadimagefinish () {
Console.log (' document.body.clientWidth ' + document.body.clientWidth);
Console.log (' document.body.clientHeight ' + document.body.clientHeight);
Console.log (' window.screen.height ' + window.screen.height);
Console.log (' window.screen.width ' + window.screen.width);
Console.log (' window.screen.availHeight ' + window.screen.availHeight);
Console.log (' window.screen.availWidth ' + window.screen.availWidth);
Console.log (' window.innerwidth ' + window.innerwidth);
Console.log (' window.innerheight ' + window.innerheight);
Console.log (' window.outerwidth ' + window.outerwidth);
Console.log (' window.outerheight ' + window.outerheight);
Console.log (' window.screenleft ' + window.screenleft);
Console.log (' window.screentop ' + window.screentop);
Console.log (' window.screeny ' + window.screeny);
Console.log (' Window.screenx ' + Window.screenx);
}
var = window.setinterval (Loadimagefinish, Timerid);
</script>
WebView set to 300*280
Test equipment IPad
This is debug using Safair:
Comparison of two item discoveries
Material One
<meta Name= "Viewport" content= "initial-scale=0.5 user-scalable=no" />
Item Two
<meta Name= "Viewport" content= "Width=device-width, user-scalable=no">
Personally think: Because the setting of viewport results in material two document.body.clientWidth return width is the width of the device, document.body.clientHeight height in accordance with the proportion of 300*280 magnification 280* (768/300) =716.8 (approximately equal to 717)
To get the actual width of the webview, consider using Window.innerwidth,window.innnerheight. (Data reality These two returned values do not include the border width)
A summary of the width and height in iOS webview