📄 append1.html
字号:
<HTML>
<BODY>
<P>
<A NAME="objects"><H1>Objects</H1></A>
<P>The following objects are available in JavaScript:
<TABLE width=70%>
<TR>
<TD>
<LI><A HREF=#anchor_object>anchor</A>
<LI><A HREF=#applet_object>applet</A>
<LI><A HREF=#button_object>button</A>
<LI><A HREF=#checkbox_object>checkbox</A>
<LI><A HREF=#Date_object>Date</A>
<LI><A HREF=#document_object>document</A>
<LI><A HREF=#form_object>form</A>
<LI><A HREF=#history_object>history</A>
<LI><A HREF=#link_object>link</A>
<LI><A HREF=#location_object>location</A>
</TD>
<TD>
<LI><A HREF=#Math_object>Math</A>
<LI><A HREF=#password_object>password</A>
<LI><A HREF=#radioButton_object>radioButton</A>
<LI><A HREF=#reset_object>reset</A>
<LI><A HREF=#selection_object>selection</A>
<LI><A HREF=#string_object>string</A>
<LI><A HREF=#submit_object>submit</A>
<LI><A HREF=#text_object>text</A>
<LI><A HREF=#textArea_object>textArea</A>
<LI><A HREF=#window_object>window</A>
</TD>
</TR>
</TABLE>
<P>
<b>NOTE:</b> Each object topic indicates whether the object is part of the client (in Navigator),
server (in LiveWire), or is common (built-in to JavaScript).
Server objects are not included in this version of the documentation.
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="anchor_object"><H2>anchor object (client)</H2></A>
<P>An anchor is a piece of text identified as the target of a hypertext link.
<H3>Syntax</H3>
<P>To define an anchor, use standard HTML syntax :
<PRE>
<A NAME="<I>anchorName</I>"
<I>anchorText</I>
</A>
</PRE>
<! xxx ->
<! xxx Brendan said to explain hash (#) a bit here. ->
<! xxx ->
<P><I>NAME</I> specifies a tag that becomes an available hypertext target within the current document.
<BR><I>anchorText</I> specifies the text to display at the anchor.
<H3>Description</H3>
<P>You can reference the anchor objects in your code by using the anchors property of the document object. The anchors property is an array that contains an entry for each anchor in a document.
<P>xxx to be supplied
<H3>Properties</H3>
<LI>xxx to be supplied
<H3>Methods</H3>
<LI>xxx to be supplied
<H3>Event handlers</H3>
<P>None.
<H3>Examples</H3>
<XMP>
<A NAME="javascript_intro"><H2>Welcome to JavaScript</H2></A>
</XMP>
<H3>See also</H3>
<LI><A HREF=#link_object>link</A> object
<LI><A HREF=props.html#anchors_property>anchors</A> property
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="applet_object"><H2>applet object (client)</H2></A>
<! xxx ->
<! xxx Rand will document the basics of the applet object when implemented. ->
<! xxx ->
<P>Represents a Java applet. xxx NYI.
<H3>Syntax</H3>
<P>
xxx to be supplied
<H3>Description</H3>
<! xxx ->
<! xxx Brendan suggests that the following paragraph go in the release notes instead. ->
<! xxx ->
<P>The applet object executes applets written in Java, not JavaScript. Java applets execute only on Netscape 2.0 and HotJava, and only on 32-bit platforms, such as Windows 95, Windows NT, and Unix. They do not execute on the 16-bit Windows platforms, such as Windows 3.1.
<H3>Properties</H3>
<LI><A HREF=props.html#length_property>length</A>
<H3>Methods</H3>
<LI>xxx to be supplied
<H3>Event handlers</H3>
<LI>xxx to be supplied
<H3>Examples</H3>
<P>xxx to be supplied
<H3>See also</H3>
<LI>xxx to be supplied
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="button_object"><H2>button object (client)</H2></A>
<P>A button object is a pushbutton on an HTML form.
<H3>Syntax</H3>
<PRE>
<INPUT
TYPE="button"
NAME="<I>objectName</I>"
VALUE="<I>buttonText</I>"
[onClick="<I>handlerText</I>"]>
</PRE>
<I>NAME</I> specifies the name of the button object as a property of the enclosing form object and can be accessed using the name property.
<I>VALUE</I> specifies the label to display on the button face and can be accessed using the value property.
<H3>Description</H3>
<P>The button object is a custom button that you can use to perform an action you define.
<H3>Properties</H3>
<LI><A HREF=props.html#name_property>name</A>
<LI><A HREF=props.html#value_property>value</A>
<H3>Methods</H3>
<LI><A HREF=methods.html#click_method>click</A>
<H3>Event handlers</H3>
<LI><A HREF=events.html#onClick_event>onClick</A>
<H3>Examples</H3>
<P>A custom button does not necessarily load a new page into the client; it merely executes the script specified by the onClick event handler. In the following example, <I>myfunction()</I> is a JavaScript function.
<XMP>
<INPUT TYPE="button" VALUE="Calculate" NAME="calc_button"
onClick="myfunction(this.form)">
</XMP>
<H3>See also</H3>
<LI><A HREF=#reset_object>reset</A> and <A HREF=#submit_object>submit</A> objects
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="checkbox_object"> <H2>checkbox object (client)</H2></A>
<P>A checkbox object is a checkbox on an HTML form. A checkbox is a toggle switch that lets the user set a value on or off.
<H3>Syntax</H3>
<P>To define a checkbox, use standard HTML syntax with the addition of the onClick event handler:
<PRE><INPUT
TYPE="checkbox"
NAME="<I>objectName</I>"
[CHECKED]
[onClick="<I>handlerText</I>"]>
<I>textToDisplay</I>
</PRE>
<H3>Description</H3>
<P>
Use the checked property to specify whether the checkbox is currently checked. Use the defaultChecked property to specify whether the checkbox is checked when the form is loaded.
<H3>Properties</H3>
<LI><A HREF=props.html#checked_property>checked</A>
<LI><A HREF=props.html#defaultChecked_property>defaultChecked</A>
<LI><A HREF=props.html#name_property>name</A>
<LI><A HREF=props.html#value_property>value</A>
<H3>Methods</H3>
<LI><A HREF=methods.html#click_method>click</A>
<H3>Event handlers</H3>
<LI><A HREF=events.html#onClick_event>onClick</A>
<H3>Examples</H3>
<XMP>
<B>Specify your music preferences (check all that apply):</B>
<BR><INPUT TYPE="checkbox" NAME="musicpref_rnb" CHECKED> R&B
<BR><INPUT TYPE="checkbox" NAME="musicpref_jazz" CHECKED> Jazz
<BR><INPUT TYPE="checkbox" NAME="musicpref_blues" CHECKED> Blues
<BR><INPUT TYPE="checkbox" NAME="musicpref_newage" CHECKED> New Age
</XMP>
<H3>See also</H3>
<LI>xxx to be supplied
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="Date_object"><H2>Date object (common)</H2></A>
<P>
JavaScript has a date object that enables you to work with dates and times.
JavaScript handles dates very similar to the way Java handles dates:
They have many of the same date methods, and both languages
store dates internally as the number of milliseconds since January 1, 1970 00:00:00.
<H3>Syntax</H3>
<P>To create a date object:
<PRE>
<I>varName</I> = new Date(<I>parameters</I>)
</PRE>
where <I>varName</I> is a JavaScript variable name for the date object being created;
it can be a new object or a property of an existing object.
<P>
The <I>parameters</I> for the Date constructor can be any of the following:
<UL>
<LI>Nothing: creates today's date and time. For example,
<code>today = new Date()</code>
<LI>A string representing a date in the following form:
"Month day, year hours:minutes:seconds". For example,
<code>
Xmas95= new Date("December 25, 1995 13:30:00")
</code>
If you omit hours, minutes, or seconds, the value will be set to zero.
<LI>A set of integer values for year, month, and day.
For example,
<code>
Xmas95 = new Date(95,11,25)
</code>
<LI>A set of values for year, month, day, hour, minute, and seconds
For example,
<code>
Xmas95 = new Date(95,11,25,9,30,0)
</code>
</UL>
<P>
To use date methods:
<PRE>
<I>dateObj.methodName(parameters)</I>
</PRE>
<P>
Exceptions: The UTC and parse methods of date are static methods that you use as follows:
<pre>
Date.UTC(<i>params</i>)
Date.parse(<i>params</i>)
</pre>
<H3>Description</H3>
<P>JavaScript does not have a date data type. However, the date object and its methods
enable you to work with dates and times in your applications.
<P>The date object has a large number of methods for setting, getting, and manipulating dates.
<H3>Properties</H3>
<P>None.
<H3>Methods</H3>
<LI><A HREF=methods.html#getDate_method>getDate</A>
<LI><A HREF=methods.html#getDay_method>getDay</A>
<LI><A HREF=methods.html#getHours_method>getHours</A>
<LI><A HREF=methods.html#getMinutes_method>getMinutes</A>
<LI><A HREF=methods.html#getMonth_method>getMonth</A>
<LI><A HREF=methods.html#getSeconds_method>getSeconds</A>
<LI><A HREF=methods.html#getTime_method>getTime</A>
<LI><A HREF=methods.html#getTimeZoneOffset_method>getTimeZoneoffset</A>
<LI><A HREF=methods.html#getYear_method>getYear</A>
<LI><A HREF=methods.html#parse_method>parse</A>
<LI><A HREF=methods.html#setDate_method>setDate</A>
<LI><A HREF=methods.html#setHours_method>setHours</A>
<LI><A HREF=methods.html#setMinutes_method>setMinutes</A>
<LI><A HREF=methods.html#setMonth_method>setMonth</A>
<LI><A HREF=methods.html#setSeconds_method>setSeconds</A>
<LI><A HREF=methods.html#setYear_method>setYear</A>
<LI><A HREF=methods.html#toString_method>toString</A>
<LI><A HREF=methods.html#toGMTString_method>toGMTString</A>
<LI><A HREF=methods.html#toLocaleString_method>toLocaleString</A>
<LI><A HREF=methods.html#UTC_method>UTC</A>
<H3>Event handlers</H3>
<P>
None. Built-in objects do not have event handlers.
<H3>Examples</H3>
<P>
xxx to be supplied
<H3>See also</H3>
<LI>xxx to be supplied
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="document_object"><H2>document object (client)</H2> </A>
<P>The document object contains information on the current document.
<H3>Syntax</H3>
<! xxx ->
<! xxx need info about color names. See email from Brendan ->
<! xxx ->
<P>To define a document object, use standard HTML syntax with the addition of the onLoad and onUnLoad event handlers:
<PRE>
<BODY
BACKGROUND="<I>backgroundImage</I>"
BGCOLOR="#<I>backgroundColor</I>"
FGCOLOR="#<I>foregroundColor</I>"
LINK="#<I>unfollowedLinkColor</I>"
ALINK="#<I>activatedLinkColor</I>"
VLINK="#<I>followedLinkColor</I>"
[onLoad="<I>handlerText</I>"]
[onUnLoad="<I>handlerText</I>"]>
</BODY>
</PRE>
<P><I>BGCOLOR</I>, <I>FGCOLOR</I>, <I>LINK</I>, <I>ALINK</I>, and <I>VLINK</I> are color names or color specifications in the format "#rrggbb".
<H3>Description</H3>
<P>The <BODY>...</BODY> tag encloses an entire document, which is defined by the current URL. The entire body of the document (all other HTML elements for the document) goes within the <BODY>...</BODY> tag.
<P>You can reference the anchors, forms, and links of a document by using the anchors, forms, and links properties. These properties are arrays that contain an entry for each anchor, form, or link in a document.
<! xxx ->
<! xxx This next paragraph might not be needed. Is it useful? ->
<! xxx ->
<P>The document object's title property reflects the contents of <TITLE>...</TITLE>. Other properties reflect the contents of the document; for example, bgColor reflects the background color, and lastModified reflects the time last modified. Some of the properties are reflections from HTML attributes; for example, the links property is a reflection of all the links in the document, and the forms property is a reflection of all the forms in the document.
<H3>Properties</H3>
<LI><A HREF=props.html#alinkColor_property>alinkColor</A>
<LI><A HREF=props.html#anchors_property>anchors</A>
<LI><A HREF=props.html#bgColor_property>bgColor</A>
<LI><A HREF=props.html#fgColor_property>fgColor</A>
<LI><A HREF=props.html#forms_property>forms</A>
<LI><A HREF=props.html#lastModified_property>lastModified</A>
<LI><A HREF=props.html#linkColor_property>linkColor</A>
<LI><A HREF=props.html#links_property>links</A>
<LI><A HREF=props.html#loadedDate_property>loadedDate</A>
<LI><A HREF=props.html#location_property>location</A>
<LI><A HREF=props.html#referrer_property>referrer</A>
<LI><A HREF=props.html#title_property>title</A>
<LI><A HREF=props.html#vlinkColor_property>vlinkColor</A>
<H3>Methods</H3>
<LI><A HREF=methods.html#clear_method>clear</A>
<LI><A HREF=methods.html#close_method>close</A>
<LI><A HREF=methods.html#open_method>open</A>
<LI><A HREF=methods.html#write_method>write</A>
<LI><A HREF=methods.html#writeln_method>writeln</A>
<H3>Event handlers</H3>
<LI><A HREF=events.html#onLoad_event>onLoad</A>
<LI><A HREF=events.html#onUnLoad_event>onUnLoad</A>
<H3>Examples</H3>
<P>
xxx to be supplied
<H3>See also</H3>
<LI><A HREF=#window_object>window</A> object
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -