*クライアント情報を調べる
-windowsアプリは, form等もすべて自前で設定するのに対して, webアプリは, 使っている環境に合わせる必要がときどきある。
-そのため, クライアント情報を調べ,それに合わせることが必要になる。
-
navigator
-
screen
-
window サイズ
-
location
-
history
-
document
-
time
*画面の大きさを調べる
** windows IE の場合(テストマシン(1)では)
|screen.width|1680|screen.height|1050|
|screen.availWidth|1680|screen.availHeight|1010|
|document.body.clientWidth|1043|document.body.clientHeight|223|
|innerWidth|1059|innerHeight|800|
|outerWidth|1325|outerHeight|845|
** windows FireFox の場合(テストマシン(1)では)
|screen.width|1680|screen.height|1050|
|screen.availWidth|1680|screen.availHeight|1010|
|document.body.clientWidth|793|document.body.clientHeight|244|
|innerWidth|809|innerHeight|800|
|outerWidth|1022|outerHeight|726|
** windows Sarafi の場合(テストマシン(1)では)
|screen.width|1680|screen.height|1050|
|screen.availWidth|1680|screen.availHeight|1010|
|document.body.clientWidth|793|document.body.clientHeight|234|
|innerWidth|809|innerHeight|800|
|outerWidth|1024|outerHeight|1010|
** windows Chrome の場合(テストマシン(1)では)
|screen.width|1680|screen.height|1050|
|screen.availWidth|1680|screen.availHeight|1010|
|document.body.clientWidth|977|document.body.clientHeight|215|
|innerWidth|993|innerHeight|800|
|outerWidth|1245|outerHeight|990|
** iPad safari の場合(横向き:full画面)
|screen.width|768|screen.height|1024|
|screen.availWidth|748|screen.availHeight|1024|
|document.body.clientWidth|964|document.body.clientHeight|243|
|innerWidth|981|innerHeight|644|
|outerWidth|1024|outerHeight|1088|
** iPad safari の場合(縦向き:full画面)
|screen.width|768|screen.height|1024|
|screen.availWidth|748|screen.availHeight|1024|
|document.body.clientWidth|964|document.body.clientHeight|243|
|innerWidth|980|innerHeight|1185|
|outerWidth|768|outerHeight|928|
** iPad safari の場合(横向き:分割画面)
|screen.width|768|screen.height|1024|
|screen.availWidth|748|screen.availHeight|1024|
|document.body.clientWidth|784|document.body.clientHeight|243|
|innerWidth|800|innerHeight|800|
|outerWidth|1024|outerHeight|967|
** iPad safari の場合(縦向き)
|screen.width|768|screen.height|1024|
|screen.availWidth|748|screen.availHeight|1024|
|document.body.clientWidth|784|document.body.clientHeight|243|
|innerWidth|800|innerHeight|800|
|outerWidth|768|outerHeight|928|
** sony tablet P の場合(横向き)
|screen.width|1024|screen.height|960|
|screen.availWidth|1024|screen.availHeight|960|
|document.body.clientWidth|964|document.body.clientHeight|240|
|innerWidth|980|innerHeight|773|
|outerWidth|1024|outerHeight|856|
* navigator
** PC IE9
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
** PC FireFox
Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0
** PC Safari
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
** PC Chrome
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
** PC Opera
Opera/9.80 (Windows NT 6.1; U; ja) Presto/2.10.229 Version/11.62
** iPad
Mozilla/5.0 (iPad; CPU OS 6_0_1 like Mac OS X) Apple WebKit/536.26 (KHTM+, like Gecko) Version 6.0 Mobile/10A523 Safari/8536.25
** sony tablet P の場合
Mozilla/5.0(Linux; U; Android 4.0.3;jp-jp; Sony Tablet P Build/TISU0144) AppleWebkit/ 534.30(KHTML, like Gecko) Version/4.0 Safari/534.30