javascript手冊-u-z[7]

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

本文简介:选择自 longj 的 blog

the second window is named: " + window2.name + "")

win2.htm, which defines the content for window2, contains the following code:

<htm> <head> <title>window object example: window 2</title> </head> <body bgcolor="oldlace" onload="alert('message from ' + window.name + ': hello, world.')" onunload="alert('message from ' + window.name + ': i\'m closing')"> <b>some numbers</b> <li>one <li>two <li>three <li>four <li>five <li>six <li>seven <li>eight <li>nine </body> </htm>

相关 the example for the frame object.

相关

  • document and frame objects

    window property

    the window property is a synonym for the current window or frame.

    语法

    1. window.propertyname
    2. window.methodname
    

    propertyname is the defaultstatus, status, length, or name property when the calling window refers to a window object.
    propertyname is the length or name property when the calling window refers to a frame object.
    methodname is any method associated with the window object.

    property of

    frame, window

    描述

    the window property refers to the current window or frame.

    although you can use the window property as a synonym for the current frame, your code is more readable if you use the self property. for example, window.name and self.name both specify the name of the current frame, but self.name is easier to understand.

    use the window property to disambiguate a property of the window object from a form or form element of the same name. you can also use the window property to make your code more readable.

    the window property is read-only. the value of the window property is

         <object nameattribute>
    where nameattribute is the name attribute if window refers to a frame, or an internal reference if window refers to a window.

    例子

    in the following example, window.status is used to set the status property of the current window. this usage disambiguates the status property of the current window from a form called "status" within the current window.

    <a href="http://dev.csdn.net/article/10/" onclick="this.href=pickrandomurl()" onmouseover="window.status='pick a random url' ; return true"> go!</a>

    相关

  • self property

    write method

    writes one or more htm expressions to a document in the specified window.

    语法

    document.write(expression1 [,expression2], ...[,expressionn])
    expression1 through expressionn are any javascript expressions or the properties of existing objects.

    用法

    document

    描述

    the write method displays any number of expressions in a document window. you can specify any javascript expression with the write method, including numerics, strings, or logicals.

    the write method is the same as the writeln method, except the write m

  • 本文关键:javascript
     

    本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

    go top