亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

JavaScript ? - ???? ?? ??

???? ?? ??(BOM)

???? ?? ??(BOM)? ?? ???? ??? ????.

?? ????? JavaScript ?? ??? ?? (??) ??? ??? ? ??? ???? ??? ?? BOM?? ???? ??? ? ?????.

window ??

????? ??? ?? ? ??? ?????. ?, ? ??? ?????? ?? ?? ?????.

? ??? ?? ????, ?? ??? ?? ??? ??? ? ????. ?? ?? window.document ?? document? ??? ? ????. ?????, Window.alert() ??? ?? Alert()? ???? ?? ?? ?? ? ??? ???? ??? ??? ? ????.

??? ???? ???? ??? ????? ??? ?? ? ??? ? ???? ?? ?? ? ??? ????.

?: ? ??? ?? ??? ?? ??? ??? ?? ????? ? ??? ?????.

HTML DOM? ??? ? ??? ?? ? ????? ???:

window.document.getElementById("header");

??? ????:

document.getElementById("header") ;


Window Size

???? ?(?? ??? ??? ??? ??? ????? ???)? ??? ???? ? ?? ??? ????.

Internet Explorer, Chrome, Firefox, Opera ? Safari? ??:

window.innerHeight - ???? ?? ?? ??

window.innerWidth - ???? ?? ?? ??

Internet Explorer 8, 7, 6? ?? , 5 :

document.documentElement.clientHeight

document.documentElement.clientWidth

??

document.body.clientHeight

document.body.clientWidth

???? JavaScript ???(?? ????? ??):

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
<p id="demo"></p>
<script>
var w=window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
var h=window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
x=document.getElementById("demo");
x.innerHTML="瀏覽器window寬度: " + w + ", 高度: " + h + "。"
</script>
</body>
</html>

?? ? ???

?? ???:

window.open() - ? ? ??

window.close() - ?? ? ??

window.moveTo() - ?? ? ??

window .resizeTo( ) - ?? ? ??? ?????


???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <script type="text/javascript"> myWindow=window.open('','','width=200,height=100') myWindow.document.write("This is 'myWindow'") myWindow.moveTo(0,0) </script> </head> <body> <p>把新窗口移動(dòng)到指定屏幕左上角(屏幕左上角為 0,0 坐標(biāo),往右和下計(jì)算為正)</p> </body> </html>