Js to obtain the computer resolution of the idea and operation

  • 2020-03-29 23:58:06
  • OfStack

When making a page, the user requires different resolutions and different positions of the popup window. I wonder if I can get the screen width first, then pay the value to the variable, and then set the parameters in onclick

function centerWindow(url,w,h){ 
<input type=button onclick="centerWindow('about:blank',200,200)"> 

var s =" Page visible area width: "+ document.body.clientWidth; 
s+="rn High visibility area: "+ document.body.clientHeight; 
s += "rn Full text width: "+ document.body.scrollWidth; 
s += "rn Full text of the web page: "+ document.body.scrollHeight; 
s += "rn On the body of the page: "+ window.screenTop; 
s += "rn Page body part left: "+ window.screenLeft; 
s += "rn High screen resolution: "+ window.screen.height; 
s += "rn Width of screen resolution: "+ window.screen.width; 
s +="rn Screen available workspace height: "+ window.screen.availHeight; 
s +="rn Screen available workspace width: "+ window.screen.availWidth; 

<!-- Begin 
function redirectPage() { 
/*var url640x480 = "http://www.yourweb.com/640x480.html";** Remember to change the page accordingly */ 
var url800x600 = "index1.asp"; 
var url1024x768 = "index2.asp"; 
if (screen.width <= 800 ) 
window.location.href= url800x600; 
else if ((screen.width >= 1024) ) 
window.location.href= url1024x768; 
// End --> 

This code displays different pages on different screens

Here's what passes this parameter
<script language=JavaScript> 
document.write("<a href='WebStat/index.asp'>"); 
document.write("<img src='WebStat/count.asp?Referer=<%=refer%> 
"' border=0 width=1 height=1>"); 

Related articles: