window
window¶ÔÏóÊÇä¯ÀÀÆ÷»òÕß¿ò¼Ü×ÔÉí.top×ÜÊÇä¯ÀÀÆ÷,parentÊǸ¸¿ò¼Ü,self±íʾ×Ô¼º.
windowͨ³£¿ÉÒÔÊ¡ÂÔ.
´°¿Ú²Ù×÷: moveBy(dx, dy), moveTo(x, y),
resizeBy(dw, dh), resizeTo(w, h).
µ¼º½: window.open(url, frame
name, attribute). attribute¿ÉÒÔÊÇleft, top, height, width, resizable,
scrollable, toolbar, status, location(all default no).
window.open
·µ»Øд°¿ÚÒýÓÃ,²¢ÇÒÓÐÒ»¸öopener¶ÔÏó±íʾ¸¸´°¿Ú
window.close.
¶Ô»°¿ò:
alert, confirm, prompt.
״̬À¸: window.status, window.defaultStatus
ʱ
¼ä¼ä¸ôºÍÔÝÍ£: timeoutId = setTimeout("alert('hello world')", 1000);
clearTimeout(timeoutId);ÀàËÆÓÐsetIntervalºÍclearInterval.
ÀúÊ·:
window.history.go(+-n), history.back, history.forward. history.length
document
alert(window.document
== document) == true. ËûÊÇΨһһ¸ö¼ÈÊôÓÚDOMÓÖÊôÓÚBOMµÄ¶ÔÏó
ÊôÐÔ:title, URL,
referrer, lastModified
¼¯ºÏÊôÐÔ: anchors, applets, embeds, forms,
images, links.
·½·¨: write, writeln.
±ØÐëÔÚÍêÈ«ÔØÈëÒ³ÃæÇ°µ÷ÓÃwrite()ºÍwriteln()·½·¨. Èç¹ûÈκÎÒ»¸ö·½·¨ÊÇÔÚÒ³ÃæÔØÈëºóµ÷ÓõÄ,Ëü½«Ä¨È¥Ò³ÃæµÄÄÚÈÝ,ÏÔʾָ¶¨µÄÄÚÈÝ.
location
windowºÍ
documentµÄÊôÐÔ,Ï໥µÈ¼Û.
ÊôÐÔ: hash(λÓÚ#ºóÃæµÄ¶«Î÷), host, hostname, href,
pathname, port, protocol, search(λÓÚ?ºóÃæµÄ¶«Î÷).
·½·¨: assign(),
replace(), reload(false=´Ó»º´æÖе¼Èë(default),true=´Ó·þÎñÆ÷¶Ëµ¼Èë)
navigatorºÍ
screen¶ÔÏó
navigator¶ÔÏó±íʾÁËä¯ÀÀÆ÷±¾Éí,¿ÉÒÔ»ñȡһЩÊôÐÔ,µ«ÊǸ÷¸öä¯ÀÀÆ÷Ö§³Ö²»Í¬.
screen
¶ÔÏó¿ÉÒԵõ½Óû§ÏµÍ³µÄÐÅÏ¢,ÈçavailHeight, availWidth(¿ÉÓÃÆÁÄ»¿í¶ÈºÍ¸ß¶È,ÅųýÁËϵͳÈÎÎñÀ¸), colorDepth,
height, width.
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
³ÌÐòÉè¼ÆÖлᾳ£Åöµ½Ò»ÖÖÇé¿ö£¬¾ÍÊÇÊÂÏÈÎÞ·¨µÃÖªÓû§»áÐèÒªÄÄЩÊý¾Ý£¬±ØÐë¸ù¾ÝÓû§Ñ¡ÔñºóÔÙ´Ó·þÎñÆ÷
ÖØÐÂÌáÈ¡Êý¾Ýºó·´À¡¸øÓû§¡£±ÈÈçÒ»¼òµ¥µÄÇé¿ö£¬Óû§Ñ¡ÔñÊ¡·ÝÒÔºó£¬ÎÒÃÇÁ¢¼´»áÔÚÊÐÀï±ß½«Õâ¸öÊ¡µÄËùÓÐ
ÊÐÖØÐÂÏÔʾ³öÀ´¡£ÕâÖÖÇé¿öÒ»°ãÐèÒª½«Õû¸öÒ³Ãæˢкó²Å¿ÉÒÔÖØжÁÈ¡£¬µ«ÕâÑù²»½öЧÂʲ»¸ßÍ⣬ҲÏԵò»
Ì«ÓÅÑÅ¡£Æäʵ ......