⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ref_f-g.htm

📁 搜集的很多javascript实例及教程
💻 HTM
📖 第 1 页 / 共 4 页
字号:
   [&LTFRAME SRC="<I>locationOrURL</I>" NAME="<I>frameName</I>"&GT]
&LT/FRAMESET&GT
</PRE>
<I>ROWS="rowHeightList"</I> is a comma-separated list of values specifying the row-height of the frame. An optional suffix defines the units. Default units are pixels.
<BR><I>COLS="columnWidthList"</I> is a comma-separated list of values specifying the column-width of the frame. An optional suffix defines the units. Default units are pixels.
<BR><I>&LTFRAME&GT</I> defines a frame.
<BR><I>SRC="locationOrURL"</I> specifies the URL of the document to be displayed in the frame. The URL cannot include an anchor name; for example <TT>&LTFRAME SRC="doc2.htm#colors" NAME="frame2"&GT</TT> is invalid. See the <A HREF="ref_h-l.htm#location_object" tppabs="http://www.nease.net/~jim/ref_h-l.htm#location_object">location</A> object for a 描述 of the URL components.
<BR><I>NAME="frameName"</I> specifies a name to be used as a target of hyperlink jumps.

<P>To use a frame object's properties:
<PRE>
1. [<I>windowReference</I>.]<I>frameName</I>.<I>propertyName</I>
2. [<I>windowReference</I>.]frames[<I>index</I>].<I>propertyName</I>
3. window.<I>propertyName</I>
4. self.<I>propertyName</I>
5. parent.<I>propertyName</I>
</PRE>
<I>windowReference</I> is a variable <I>windowVar</I> from a window definition (see <A HREF="ref_t-z.htm#window_object" tppabs="http://www.nease.net/~jim/ref_t-z.htm#window_object">window</A> object), or one of the synonyms top or parent.
<BR><I>frameName</I> is the value of the NAME attribute in the &LTFRAME&GT tag of a frame object.
<BR><I>index</I> is an integer representing a frame object.
<BR><I>propertyName</I> is one of the properties listed below.


<H3>Property of</H3>
<LI>The frame object is a property of <A HREF="ref_t-z.htm#window_object" tppabs="http://www.nease.net/~jim/ref_t-z.htm#window_object">window</A>
<LI>The frames array is a property of both <A HREF="ref_f-g.htm#frame_object" tppabs="http://www.nease.net/~jim/ref_f-g.htm#frame_object">frame</A> and <A HREF="ref_t-z.htm#window_object" tppabs="http://www.nease.net/~jim/ref_t-z.htm#window_object">window</A>


<H3>描述</H3>
<P>The &LTFRAMESET&GT tag is used in an htm document whose sole purpose is to define the layout of frames that make up a page. Each frame is a window object.

<P>If a &LTFRAME&GT tag contains SRC and NAME attributes, you can refer to that frame from a sibling frame by using <TT>parent.<I>frameName</I></TT> or <TT>parent.frames[<I>index</I>]</TT>. For example, if the fourth frame in a set has NAME="homeFrame", sibling frames can refer to that frame using <TT>parent.homeFrame</TT> or <TT>parent.frames[3]</TT>.

<P>The self and window properties are synonyms for the current frame, and you can optionally use them to refer to the current frame. You can use these properties to make your code more readable. See the properties listed below for 例子.

<P>The top and parent properties are also synonyms that can be used in place of the frame name. top refers to the top-most window that contains frames or nested framesets, and parent refers to the window containing the current frameset. See the <A HREF="ref_t-z.htm#top_property" tppabs="http://www.nease.net/~jim/ref_t-z.htm#top_property">top</A> and <A HREF="ref_m-q.htm#parent_property" tppabs="http://www.nease.net/~jim/ref_m-q.htm#parent_property">parent</A> properties.

<H4>The <I>frames</I> array</H4>
<P>You can reference the frame objects in your code by using the <I>frames</I> array. This array contains an entry for each child frame (&ltFRAME&gt tag) in a window containing a &LTFRAMESET&GT tag in source order. For example, if a window contains three child frames, these frames are reflected as <TT>parent.frames[0]</TT>, <TT>parent.frames[1]</TT>, and <TT>parent.frames[2]</TT>.

<P>To use the <I>frames</I> array:
<PRE>
1. [<I>frameReference</I>.]frames[<I>index</I>]
2. [<I>frameReference</I>.]frames.length
3. [<I>windowReference</I>.]frames[<I>index</I>]
4. [<I>windowReference</I>.]frames.length
</PRE>
<P><I>frameReference</I> is a valid way of referring to a frame, as described in the <A HREF="ref_f-g.htm#frame_object" tppabs="http://www.nease.net/~jim/ref_f-g.htm#frame_object">frame</A> object.
<BR><I>windowReference</I> is a variable <I>windowVar</I> from a window definition (see <A HREF="ref_t-z.htm#window_object" tppabs="http://www.nease.net/~jim/ref_t-z.htm#window_object">window</A> object), or one of the synonyms top or parent.
<BR><I>index</I> is an integer representing a frame in a parent window.

<P>To obtain the number of child frames in a window or frame, use the length property:
<PRE>
[<I>windowReference</I>.].frames.length
[<I>frameReference</I>.].frames.length
</PRE>

<P>Elements in the <I>frames</I> array are read-only. For example, the statement <TT><I>windowReference</I>.frames[0]="frame1"</TT> has no effect.

<P>The value of each element in the <I>frames</I> array is <TT>&ltobject <I>nameAttribute</I>&gt</TT>, where <I>nameAttribute</I> is the NAME attribute of the frame.


<H3>Properties</H3>
<P>The frame object has the following properties:
<LI><A HREF="ref_f-g.htm#frame_object" tppabs="http://www.nease.net/~jim/ref_f-g.htm#frame_object">frames</A> is an array reflecting all the frames in a window
<LI><A HREF="ref_m-q.htm#name_property" tppabs="http://www.nease.net/~jim/ref_m-q.htm#name_property">name</A> reflects the NAME attribute of the &LTFRAME&GT tag
<LI><A HREF="ref_h-l.htm#length_property" tppabs="http://www.nease.net/~jim/ref_h-l.htm#length_property">length</A> reflects the number of child frames within a frame
<LI><A HREF="ref_m-q.htm#parent_property" tppabs="http://www.nease.net/~jim/ref_m-q.htm#parent_property">parent</A> is a synonym for the window or frame containing the current frameset
<LI><A HREF="ref_s-s.htm#self_property" tppabs="http://www.nease.net/~jim/ref_s-s.htm#self_property">self</A> is a synonym for the current frame
<LI><A HREF="ref_t-z.htm#window_property" tppabs="http://www.nease.net/~jim/ref_t-z.htm#window_property">window</A> is a synonym for the current frame

<P>The <I>frames</I> array has the following properties:
<LI><A HREF="ref_h-l.htm#length_property" tppabs="http://www.nease.net/~jim/ref_h-l.htm#length_property">length</A> reflects the number of child frames within a frame


<H3>Methods</H3>
<LI><A HREF="ref_a-c.htm#clearTimeout_method" tppabs="http://www.nease.net/~jim/ref_a-c.htm#clearTimeout_method">clearTimeout</A>
<LI><A HREF="ref_s-s.htm#setTimeout_method" tppabs="http://www.nease.net/~jim/ref_s-s.htm#setTimeout_method">setTimeout</A>


<H3>Event handlers</H3>
<LI>None. The onLoad and onUnload event handlers are specified in the &LTFRAMESET&GT tag but are actually event handlers for the window object.


<H3>例子</H3>
<P>The following example creates two windows, each with four frames. In the first window, the first frame contains pushbuttons that change the background colors of the frames in both windows.

<P>FRAMSET1.htm, which defines the frames for the first window, contains the following code:
<XMP>
<htm>
<HEAD>
<TITLE>Frames and Framesets: Window 1</TITLE>
</HEAD>
<FRAMESET ROWS="50%,50%" COLS="40%,60%" onLoad="alert('Hello, World.')">
<FRAME SRC="tppmsgs/msgs0.htm#13" tppabs="http://www.nease.net/~jim/framcon1.htm" NAME="frame1">
<FRAME SRC="tppmsgs/msgs0.htm#14" tppabs="http://www.nease.net/~jim/framcon2.htm" NAME="frame2">
<FRAME SRC="tppmsgs/msgs0.htm#14" tppabs="http://www.nease.net/~jim/framcon2.htm" NAME="frame3">
<FRAME SRC="tppmsgs/msgs0.htm#14" tppabs="http://www.nease.net/~jim/framcon2.htm" NAME="frame4">
</FRAMESET>
</htm>
</XMP>

<P>FRAMSET2.htm, which defines the frames for the second window, contains the following code:
<XMP>
<htm>
<HEAD>
<TITLE>Frames and Framesets: Window 2</TITLE>
</HEAD>
<FRAMESET ROWS="50%,50%" COLS="40%,60%">
<FRAME SRC="tppmsgs/msgs0.htm#14" tppabs="http://www.nease.net/~jim/framcon2.htm" NAME="frame1">
<FRAME SRC="tppmsgs/msgs0.htm#14" tppabs="http://www.nease.net/~jim/framcon2.htm" NAME="frame2">
<FRAME SRC="tppmsgs/msgs0.htm#14" tppabs="http://www.nease.net/~jim/framcon2.htm" NAME="frame3">
<FRAME SRC="tppmsgs/msgs0.htm#14" tppabs="http://www.nease.net/~jim/framcon2.htm" NAME="frame4">
</FRAMESET>
</htm>
</XMP>

<P>FRAMCON1.htm, which defines the content for the first frame in the first window, contains the following code:
<XMP>
<htm>
<BODY>
<A NAME="frame1"><H1>Frame1</H1></A>
<P><A HREF="tppmsgs/msgs0.htm#15" tppabs="http://www.nease.net/~jim/framcon3.htm" target=frame2>Click here</A> to load a different file into frame 2.
<SCRIPT>
window2=open("framset2.htm","secondFrameset")
</SCRIPT>
<FORM>
<P><INPUT TYPE="button" VALUE="Change frame2 to teal"
   onClick="parent.frame2.document.bgColor='teal'">
<P><INPUT TYPE="button" VALUE="Change frame3 to slateblue"
   onClick="parent.frames[2].document.bgColor='slateblue'">
<P><INPUT TYPE="button" VALUE="Change frame4 to darkturquoise"
   onClick="top.frames[3].document.bgColor='darkturquoise'">

<P><INPUT TYPE="button" VALUE="window2.frame2 to violet"
   onClick="window2.frame2.document.bgColor='violet'">
<P><INPUT TYPE="button" VALUE="window2.frame3 to fuchsia"
   onClick="window2.frames[2].document.bgColor='fuchsia'">
<P><INPUT TYPE="button" VALUE="window2.frame4 to deeppink"
   onClick="window2.frames[3].document.bgColor='deeppink'">
</FORM>
</BODY>
</htm>
</XMP>

<P>FRAMCON2.htm, which defines the content for the remaining frames, contains the following code:
<XMP>
<htm>
<BODY>
<P>This is a frame.
</BODY>
</htm>
</XMP>

<P>FRAMCON3.htm, which is referenced in a link object in FRAMCON1.htm, contains the following code:
<XMP>
<htm>
<BODY>
<P>This is a frame. What do you think?
</BODY>
</htm>
</XMP>


<H3>相关</H3>
<LI><A HREF="ref_d-e.htm#document_object" tppabs="http://www.nease.net/~jim/ref_d-e.htm#document_object">document</A> and <A HREF="ref_t-z.htm#window_object" tppabs="http://www.nease.net/~jim/ref_t-z.htm#window_object">window</A> objects


<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="frames_property"><H2>frames property</H2></A>
<P>An array of objects corresponding to child frames (&ltFRAME&gt tag) in source order. See <A HREF="ref_f-g.htm#frame_object" tppabs="http://www.nease.net/~jim/ref_f-g.htm#frame_object">frame</A> object.

<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="getDate_method"><H2>getDate method</H2></A>
<P>
Returns the day of the month for the specified date.

<H3>语法</H3>
<PRE><I>dateObjectName</I>.getDate()</PRE>
<P><I>dateObjectName</I> is either the name of a date object or a property of an existing object.

<H3>方法</H3>
<P><A HREF="ref_d-e.htm#Date_object" tppabs="http://www.nease.net/~jim/ref_d-e.htm#Date_object">Date</A>

<H3>描述</H3>
<P>The value returned by getDate is an integer between 1 and 31.

<H3>例子</H3>
<P>
The second statement below assigns the value 25 to the variable <I>day</I>, based on the value of the date object <I>Xmas95</I>.
<PRE>
Xmas95 = new Date("December 25, 1995 23:15:00")
day = Xmas95.getDate()
</PRE>

<H3>相关</H3>
<LI><A HREF="ref_s-s.htm#setDate_method" tppabs="http://www.nease.net/~jim/ref_s-s.htm#setDate_method">setDate</A> method
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="getDay_method"><H2>getDay method</H2></A>
<P>
Returns the day of the week for the specified date.

<H3>语法</H3>
<PRE><I>dateObjectName</I>.getDay()</PRE>
<P><I>dateObjectName</I> is either the name of a date object or a property of an existing object.

<H3>方法</H3>
<P><A HREF="ref_d-e.htm#Date_object" tppabs="http://www.nease.net/~jim/ref_d-e.htm#Date_object">Date</A>

<H3>描述</H3>
<P>
The value returned by getDay is an integer corresponding to the day of the week: zero for Sunday, one for Monday, two for Tuesday, and so on.

<H3>例子</H3>
<P>
The second statement below assigns the value 1 to <I>weekday</I>, based on the value of the date object <I>Xmas95</I>. This is because December 25, 1995 is a Monday.
<PRE>
Xmas95 = new Date("December 25, 1995 23:15:00")
weekday = Xmas95.getDay()
</PRE>

<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="getHours_method"><H2>getHours method</H2></A>
<P>
Returns the hour for the specified date.

<H3>语法</H3>
<PRE><I>dateObjectName</I>.getHours()</PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -