方法一頁 | 二頁 | 三頁 | 四頁 | 五頁 | 六頁 | 七頁
操控器一頁 | 二頁 | 三頁 | 四頁 | 五頁 | 六頁 | 七頁 | 成員表
window
此物件實體存放視窗的特徵與方法。例如視窗的長寬或顏色,視窗的開與關等等。分頁式的瀏覽器,每一個分頁都有一個 window 物件實體。
- 程式用法:
<script type='text/javascript'>
document.write( window.constructor +'<br />');
document.write( typeof window +'<br />');
document.write( window.screen.height );
</script> - 執行結果:
function Window() { [native code] }
object
720
不同的瀏覽器,window 的成員有不同,使用時要注意。
- 程式用法:
<ol>
<script type='text/javascript'>
for(k in window)
if( typeof(window[k]) != 'function' )
document.write( '<li>'+ k +' : '+ window[k] );
</script>
</ol> - 執行結果:
- window : [object Window]
- self : [object Window]
- document : [object HTMLDocument]
- name :
- location : http://ant4js.blogspot.com/2008/12/window.html
- customElements : [object CustomElementRegistry]
- history : [object History]
- navigation : [object Navigation]
- locationbar : [object BarProp]
- menubar : [object BarProp]
- personalbar : [object BarProp]
- scrollbars : [object BarProp]
- statusbar : [object BarProp]
- toolbar : [object BarProp]
- status :
- closed : false
- frames : [object Window]
- length : 0
- top : [object Window]
- opener : null
- parent : [object Window]
- frameElement : null
- navigator : [object Navigator]
- origin : http://ant4js.blogspot.com
- external : [object External]
- screen : [object Screen]
- innerWidth : 1280
- innerHeight : 720
- scrollX : 0
- pageXOffset : 0
- scrollY : 0
- pageYOffset : 0
- visualViewport : [object VisualViewport]
- screenX : 0
- screenY : 0
- outerWidth : 1280
- outerHeight : 720
- devicePixelRatio : 1
- event : undefined
- clientInformation : [object Navigator]
- screenLeft : 0
- screenTop : 0
- styleMedia : [object StyleMedia]
- onsearch : null
- isSecureContext : false
- trustedTypes : [object TrustedTypePolicyFactory]
- performance : [object Performance]
- onappinstalled : null
- onbeforeinstallprompt : null
- crypto : [object Crypto]
- indexedDB : [object IDBFactory]
- sessionStorage : [object Storage]
- localStorage : [object Storage]
- onbeforexrselect : null
- onabort : null
- onbeforeinput : null
- onbeforematch : null
- onbeforetoggle : null
- onblur : null
- oncancel : null
- oncanplay : null
- oncanplaythrough : null
- onchange : null
- onclick : null
- onclose : null
- oncontentvisibilityautostatechange : null
- oncontextlost : null
- oncontextmenu : null
- oncontextrestored : null
- oncuechange : null
- ondblclick : null
- ondrag : null
- ondragend : null
- ondragenter : null
- ondragleave : null
- ondragover : null
- ondragstart : null
- ondrop : null
- ondurationchange : null
- onemptied : null
- onended : null
- onerror : null
- onfocus : null
- onformdata : null
- oninput : null
- oninvalid : null
- onkeydown : null
- onkeypress : null
- onkeyup : null
- onload : null
- onloadeddata : null
- onloadedmetadata : null
- onloadstart : null
- onmousedown : null
- onmouseenter : null
- onmouseleave : null
- onmousemove : null
- onmouseout : null
- onmouseover : null
- onmouseup : null
- onmousewheel : null
- onpause : null
- onplay : null
- onplaying : null
- onprogress : null
- onratechange : null
- onreset : null
- onresize : null
- onscroll : null
- onsecuritypolicyviolation : null
- onseeked : null
- onseeking : null
- onselect : null
- onslotchange : null
- onstalled : null
- onsubmit : null
- onsuspend : null
- ontimeupdate : null
- ontoggle : null
- onvolumechange : null
- onwaiting : null
- onwebkitanimationend : null
- onwebkitanimationiteration : null
- onwebkitanimationstart : null
- onwebkittransitionend : null
- onwheel : null
- onauxclick : null
- ongotpointercapture : null
- onlostpointercapture : null
- onpointerdown : null
- onpointermove : null
- onpointerrawupdate : null
- onpointerup : null
- onpointercancel : null
- onpointerover : null
- onpointerout : null
- onpointerenter : null
- onpointerleave : null
- onselectstart : null
- onselectionchange : null
- onanimationend : null
- onanimationiteration : null
- onanimationstart : null
- ontransitionrun : null
- ontransitionstart : null
- ontransitionend : null
- ontransitioncancel : null
- onafterprint : null
- onbeforeprint : null
- onbeforeunload : null
- onhashchange : null
- onlanguagechange : null
- onmessage : null
- onmessageerror : null
- onoffline : null
- ononline : null
- onpagehide : null
- onpageshow : null
- onpopstate : null
- onrejectionhandled : null
- onstorage : null
- onunhandledrejection : null
- onunload : null
- crossOriginIsolated : false
- scheduler : [object Scheduler]
- launchQueue : [object LaunchQueue]
- originAgentCluster : false
- onpageswap : null
- onpagereveal : null
- credentialless : false
- fence : null
- speechSynthesis : [object SpeechSynthesis]
- onscrollend : null
- onscrollsnapchange : null
- onscrollsnapchanging : null
- __pwInitScripts : [object Object]
- google_ad_client : pub-6650559203801165
- google_ad_host : pub-1556223355139109
- google_ad_host_channel : 00000
- google_ad_width : 728
- google_ad_height : 90
- google_ad_format : 728x90_as
- google_ad_type : text_image
- google_color_border : FFFFFF
- google_color_bg : 333377
- google_color_link : FF0000
- google_color_url : 33FFFF
- google_color_text : FFFFFF
- TEMPORARY : 0
- PERSISTENT : 1