2011-04-21 5 views

답변

1

표시되는 정보가 100 % 정확하지 않을 수 있으므로 플러그인을 식별 할 수는 있지만 지저분합니다. 이를 수행하려면 scripts like Slicer available이 있습니다.

화면 해상도를 얻으려면 Javascript를 사용해야합니다. 일부 검색 결과는 a method으로 나타났습니다.

0

PHP는 서버 측에 있으므로, 당신은 PHP와 화면 해상도가 불가능 얻기

try { 
     window.location = "protocol://etc"; 
    } catch (e){ 
     alert("Not supported"); 
    } 

같은 것을 사용할 수 그것을 설정 프로토콜이 같은 IRC와 같은 플러그인을 찾고 있다면 언어. 이를 위해 클라이언트 측 언어 (예 : 자바 스크립트)를 사용해야합니다.

이 들어

당신은 당신이 원하는 경우이 추적하기 위해 서버 측 코드에 아약스 요청을 보낼 수 있습니다 이것으로

screen.width 
screen.height 

을 사용할 수 있습니다!

편집 : 당신이 너무 window.navigator.plugins 볼 수 있습니다 더 구체적인 뭔가를 (특정 파이어 폭스) here

0

빠른 구글 검색이 뽑아. http://www.howtocreate.co.uk/tutorials/javascript/browserwindow

function alertSize() { 
    var myWidth = 0, myHeight = 0; 
    if(typeof(window.innerWidth) == 'number') { 
     //Non-IE 
     myWidth = window.innerWidth; 
     myHeight = window.innerHeight; 
    } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { 
     //IE 6+ in 'standards compliant mode' 
     myWidth = document.documentElement.clientWidth; 
     myHeight = document.documentElement.clientHeight; 
    } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) { 
     //IE 4 compatible 
     myWidth = document.body.clientWidth; 
     myHeight = document.body.clientHeight; 
    } 
    window.alert('Width = ' + myWidth); 
    window.alert('Height = ' + myHeight); 
} 

씨 당신은 다른 브라우저 조심이 기능이 작동 아주 잘해야합니다. jQuery (그리고 대부분의 다른 js 라이브러리)를 사용하는 경우 1 줄에서 모든 작업을 수행 할 수 있으며 Google을 통해 쉽게 찾을 수 있어야하는 기능이 있습니다.

관련 문제