トップへ(mam-mam.net/)

Javascriptでデバイス情報を取得(DPR,Retina)

検索:

接続デバイスの情報を表示

IPアドレス:34.205.142.9

ソースコード

<script>
document.write("スクリーンの幅:" + screen.width + "ピクセル<br>");
document.write("スクリーンの高さ:" + screen.height + "ピクセル<br>");
document.write("スクリーンの有効領域の幅:" + screen.availWidth + "ピクセル<br>");
document.write("スクリーンの有効領域の高さ:" + screen.availHeight + "ピクセル<br>");
document.write("スクリーンの色深度:" + screen.colorDepth + "ビット<br>");
document.write("スクリーンのビット深度:" + screen.pixelDepth + "ビット<br>");
document.write("CSS解像度と物理解像度の比:" + window.devicePixelRatio + "<br>");
document.write("ユーザーエージェント:"+window.navigator.userAgent+"<br>");
</script>
//ココはPHPを使用しています
IPアドレス:<?=$_SERVER["REMOTE_ADDR"]?><br>