javascript手冊-u-z[6]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 longj 的 blog

pabs="http://www.nease.net/~jim/ref_m-q.htm#name_property">name reflects the windowname argument

  • parent is a synonym for the windowname argument and refers to a window containing a frameset
  • self is a synonym for the windowname argument and refers to the current window
  • status specifies a priority or transient message in the window's status bar
  • top is a synonym for the windowname argument and refers to the top-most navigator window
  • window is a synonym for the windowname argument and refers to the current window

    the following objects are also properties of the window object:

  • document
  • frame
  • location

    methods

  • alert
  • close
  • confirm
  • open
  • prompt
  • settimeout
  • cleartimeout

    event handlers

  • onload
  • onunload

    例子

    in the following example, the document in the top window opens a second window, window2, and defines pushbuttons that open a message window, write to the message window, close the message window, and close window2. the onload and onunload event handlers of the document loaded into window2 display alerts when the window opens and closes.

    win1.htm, which defines the frames for the first window, contains the following code:

    <htm> <head> <title>window object example: window 1</title> </head> <body bgcolor="antiquewhite"> <script> window2=open("win2.htm","secondwindow","scrollbars=yes,width=250, height=400") document.writeln("<b>the first window has no name: " + window.name + "</b>") document.writeln("<br></p> <div class="clear-both"></div> </div> <div class="pages"><a href=20050818223323747.htm target="_self" >首页</a> <a href=20050818223323747_5.htm target="_self">上页</a> <a href=20050818223323747_7.htm target="_self">下页</a> <a href=20050818223323747_7.htm target="_self">尾页</a> <a href=20050818223323747.htm target="_self">[1]</a> <a href=20050818223323747_2.htm target="_self">[2]</a> <a href=20050818223323747_3.htm target="_self">[3]</a> <a href=20050818223323747_4.htm target="_self">[4]</a> <a href=20050818223323747_5.htm target="_self">[5]</a> <a href=20050818223323747_6.htm target="_self"><strong>[6]</strong></a> <a href=20050818223323747_7.htm target="_self">[7]</a> </div> <div class="keywords"> <strong>本文关键:</strong>javascript </div> <div class="ad_doc_ad_2"> <script type="text/javascript"><!-- google_ad_client = "pub-1022332794981269"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; //2007-03-23: 方案站728x90 google_ad_channel = "2351411502"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "3D81EE"; google_color_text = "4C4C4C"; google_color_url = "6C82B5"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <div class="clear-both"></div> </div> </div> <div id="content_right"> <div class="cbox" id="relate_doc"> <div class="darkboxTitle"><span>  相关方案</span></div> <div class="ad_site_index_right_1"> <!-- SiteSearch Google --> <form method="get" action="http://www.google.cn/custom" target="google_window"> <table border="0" bgcolor="#ffffff"> <tr><td nowrap="nowrap" valign="top" align="left" height="32"> <a href="http://www.google.com/"> <img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a> <br/> <input type="hidden" name="domains" value="www.cn-doc.com"></input> <label for="sbi" style="display: none">输入您的搜索字词</label> <input type="text" name="q" size="15" maxlength="255" value="" id="sbi"></input> <label for="sbb" style="display: none">提交搜索表单</label> <input type="submit" name="sa" value="搜索" id="sbb"></input> </td></tr> <tr> <td nowrap="nowrap"> <table> <tr> <td> <input type="radio" name="sitesearch" value="" id="ss0"></input> <label for="ss0" title="搜索网络"><font size="-1" color="#000000">Web</font></label></td> <td> <input type="radio" name="sitesearch" value="www.cn-doc.com" checked id="ss1"></input> <label for="ss1" title="搜索 www.cn-doc.com"><font size="-1" color="#000000">www.cn-doc.com</font></label></td> </tr> </table> <input type="hidden" name="client" value="pub-1022332794981269"></input> <input type="hidden" name="forid" value="1"></input> <input type="hidden" name="channel" value="9722277709"></input> <input type="hidden" name="ie" value="GB2312"></input> <input type="hidden" name="oe" value="GB2312"></input> <input type="hidden" name="flav" value="0000"></input> <input type="hidden" name="sig" value="Dl1iwOxBnXTtaDIa"></input> <input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:50;LW:200;L:http://www.cn-doc.com/images/forgoogle.gif;S:http://www.cn-doc.com;FORID:1"></input> <input type="hidden" name="hl" value="zh-CN"></input> </td></tr></table> </form> <!-- SiteSearch Google --> </div> <ul class="darklist"> <li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223323621.htm" title="判断客户浏览器是否支持cookie" target="_blank">判断客户浏览器是否支持cook</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223324877.htm" title="JS版常见问题(二)兼容版本的无提示关闭窗口!" target="_blank">JS版常见问题(二)兼容版本的</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223324148.htm" title="可输入的select改进版本,同一页面可有多个list,调用接口简化" target="_blank">可输入的select改进版本,</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223324190.htm" title="foolpot2001菜单" target="_blank">foolpot2001菜单</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223324620.htm" title="模拟windows control的进度条" target="_blank">模拟windows contr</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223324177.htm" title="javascript函数速查" target="_blank">javascript函数速查</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223324681.htm" title="HTML页面如何象asp一样接受参数" target="_blank">HTML页面如何象asp一样接</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223324986.htm" title="showModalDialog和showModelessDialog使用心得" target="_blank">showModalDialog</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223324647.htm" title="【推荐】一个非常漂亮的列表框" target="_blank">【推荐】一个非常漂亮的列表框</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223325998.htm" title="JS特效之状态栏冒泡" target="_blank">JS特效之状态栏冒泡</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223323304.htm" title="用Javascript转换源代码" target="_blank">用Javascript转换源代</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223323605.htm" title="事件处理函数OnEnter OnExit 使用一例" target="_blank">事件处理函数OnEnter O</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/2005081822332314.htm" title="怎样让你的表格可编辑???" target="_blank">怎样让你的表格可编辑???</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223323507.htm" title="用javascript连接数据库的解决方法" target="_blank">用javascript连接数据</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223323936.htm" title="在网页中调用本地的应用程序!!!!" target="_blank">在网页中调用本地的应用程序!!</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223323913.htm" title="用JAVASCIRPT写的一个动态显示日期的函数!" target="_blank">用JAVASCIRPT写的一个</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223323674.htm" title="JavaScript窗口功能指南之关闭窗口" target="_blank">JavaScript窗口功能指</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223322429.htm" title="用正则表达式作校验" target="_blank">用正则表达式作校验</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223322976.htm" title="Dhtml&#58浏览大图时鼠标感应控制层滚动条的移动" target="_blank">Dhtml&#58浏览大图时鼠</a>…</li><li><a href="../../_soft_javascript_tech_doc/2005_08_18_22/20050818223322267.htm" title="一个简单的俄罗斯方块脚本" target="_blank">一个简单的俄罗斯方块脚本</a>…</li> </ul> <div class="ad_site_index_right_2"> <script type="text/javascript"><!-- google_ad_client = "pub-1022332794981269"; google_ad_width = 180; google_ad_height = 60; google_ad_format = "180x60_as_rimg"; google_cpa_choice = "CAAQ0cX8zwEaCEpGRZ0Cl8yyKPu_93M"; google_ad_channel = "6903800490"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </div> </div> <div class="clear-both">&nbsp;</div> <div id="ContentBottom" class="darkBox"> <p>本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)</p><a href="#"><img src="../../images/btn_top.gif" width="51" height="11" alt="go top"/></a> </div> </div> </div> <script type="text/javascript" language="javascript" src="../../comm/doc/w3c_99_bottom.js"></script> <script type="text/javascript" language="javascript" src="../../comm/clicksum_doc.asp?typeid=46&infoid=389945"></script> <script type="text/javascript" language="JavaScript" src="../../comm/statistics.js"></script> </body> </html>