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

📄 methods.html

📁 学习源代码
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<HTML>
<body background="ee.jpg">
<A NAME="methods"><H1>JavaScript的方法</H1></A>

<P>以下的一些"方法"可用在JavaScript:
<TABLE width=70%>
<TR>
<TD>
<LI><A HREF=#abs_method>abs</A>
<LI><A HREF=#acos_method>acos</A>
<LI><A HREF=#alert_method>alert</A>
<LI><A HREF=#anchor_method>anchor</A>
<LI><A HREF=#asin_method>asin</A>
<LI><A HREF=#assign_method>assign</A>
<LI><A HREF=#atan_method>atan</A>
<LI><A HREF=#back_method>back</A>
<LI><A HREF=#big_method>big</A>
<LI><A HREF=#blink_method>blink</A>
<LI><A HREF=#blur_method>blur</A>
<LI><A HREF=#bold_method>bold</A>
<LI><A HREF=#ceil_method>ceil</A>
<LI><A HREF=#charAt_method>charAt</A>
<LI><A HREF=#clear_method>clear</A>
</TD>
<TD>
<LI><A HREF=#clearTimeout_method>clearTimeout</A>
<LI><A HREF=#click_method>click</A>
<LI><A HREF=#close_method>close</A>
<LI><A HREF=#confirm_method>confirm</A>
<LI><A HREF=#cos_method>cos</A>
<LI><A HREF=#eval_method>eval</A>
<LI><A HREF=#exp_method>exp</A>
<LI><A HREF=#fixed_method>fixed</A>
<LI><A HREF=#floor_method>floor</A>
<LI><A HREF=#focus_method>focus</A>
<LI><A HREF=#fontcolor_method>fontcolor</A>
<LI><A HREF=#fontsize_method>fontsize</A>
<LI><A HREF=#forward_method>forward</A>
<LI><A HREF=#getDate_method>getDate</A>
<LI><A HREF=#getDay_method>getDay</A>
</TD>
<TD>
<LI><A HREF=#getHours_method>getHours</A>
<LI><A HREF=#getMinutes_method>getMinutes</A>
<LI><A HREF=#getMonth_method>getMonth</A>
<LI><A HREF=#getSeconds_method>getSeconds</A>
<LI><A HREF=#getTime_method>getTime</A>
<LI><A HREF=#getTimezoneOffset_method>getTimeZoneoffset</A>
<LI><A HREF=#getYear_method>getYear</A>
<LI><A HREF=#go_method>go</A>
<LI><A HREF=#indexOf_method>indexOf</A>
<LI><A HREF=#italics_method>italics</A>
<LI><A HREF=#lastIndexOf_method>lastIndexOf</A>
<LI><A HREF=#link_method>link</A>
<LI><A HREF=#log_method>log</A>
<LI><A HREF=#max_method>max</A>
<LI><A HREF=#min_method>min</A>
</TD>
<TD>
<LI><A HREF=#open_method>open</A>
<LI><A HREF=#parse_method>parse</A>
<LI><A HREF=#pow_method>pow</A>
<LI><A HREF=#prompt_method>prompt</A>
<LI><A HREF=#random_method>random</A>
<LI><A HREF=#round_method>round</A>
<LI><A HREF=#select_method>select</A>
<LI><A HREF=#setDate_method>setDate</A>
<LI><A HREF=#setHours_method>setHours</A>
<LI><A HREF=#setMinutes_method>setMinutes</A>
<LI><A HREF=#setMonth_method>setMonth</A>
<LI><A HREF=#setSeconds_method>setSeconds</A>
<LI><A HREF=#setTimeout_method>setTimeout</A>
<LI><A HREF=#setTime_method>setTime</A>
<LI><A HREF=#setYear_method>setYear</A>
<LI><A HREF=#sin_method>sin</A>
</TD>
<TD>
<LI><A HREF=#small_method>small</A>
<LI><A HREF=#sqrt_method>sqrt</A>
<LI><A HREF=#strike_method>strike</A>
<LI><A HREF=#sub_method>sub</A>
<LI><A HREF=#submit_method>submit</A>
<LI><A HREF=#substring_method>substring</A>
<LI><A HREF=#sup_method>sup</A>
<LI><A HREF=#tan_method>tan</A>
<LI><A HREF=#toGMTString_method>toGMTString</A>
<LI><A HREF=#toLocaleString_method>toLocaleString</A>
<LI><A HREF=#toLowerCase_method>toLowerCase</A>
<LI><A HREF=#toString_method>toString</A>
<LI><A HREF=#toUpperCase_method>toUpperCase</A>
<LI><A HREF=#UTC_method>UTC</A>
<LI><A HREF=#write_method>write</A>
<LI><A HREF=#writeln_method>writeln</A>
</TD>
</TR>
</TABLE>

<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="abs_method"><H2>abs method</H2></A>
<P>Returns the absolute value of its argument.

<H3>Syntax</H3>
<PRE>abs(<I>arg</I>)</PRE>

<H3>Applies to</H3>
<P><A HREF="objects.html#Math_object" tppabs="http://www.webjx.com/js/objects.html#Math_object">Math</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="acos_method"><H2>acos method</H2></A>
<P>Returns the arc cosine (in radians) of its argument.

<H3>Syntax</H3>
<PRE>acos(<I>arg</I>)</PRE>

<H3>Applies to</H3>
<P><A HREF="objects.html#Math_object" tppabs="http://www.webjx.com/js/objects.html#Math_object">Math</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#asin_method>asin</A>, <A HREF=#atan_method>atan</A>, <A HREF=#cos_method>cos</A>, 
<A HREF=#sin_method>sin</A>, <A HREF=#tan_method>tan</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="alert_method"><H2>alert method</H2></A>
<P>
Displays an Alert dialog box with a message and an OK button.

<H3>Syntax</H3>
<PRE>alert("<I>message</I>")</PRE>
<P>The argument <I>message</I> is any string.

<H3>Description</H3>
<P>Use the alert method to display a message that does not require a user decision. The <I>message</I> argument specifies a message that the dialog box contains.

<H3>Applies to</H3>
<P><A HREF="objects.html#window_object" tppabs="http://www.webjx.com/js/objects.html#window_object">window</A>

<H3>Examples</H3>
<P>In the following example, the testValue function checks the name entered by a user in the text element of a form to make sure that it is no more than eight characters in length. This example uses the alert method to prompt the user of an application to enter a valid value.
<PRE>
function testValue(textElement) {
   if (textElement.length > 8) {
      alert("Please enter a name that is 8 characters or less")
   }
}</PRE>
You can call the testValue function in the onBlur event handler of a form's text element, as shown in the following example:
<PRE>Name: &ltINPUT TYPE="text" NAME="userName" onBlur="testValue(userName)"&gt</PRE>


<H3>See also</H3>
<LI><A HREF=#confirm_method>confirm</A>, <A HREF=#prompt_method>prompt</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="anchor_method"><H2>anchor method</H2></A>
<P>
Causes the calling string object to be a named anchor by surrounding it with HTML anchor tags, <TT> &ltA NAME=...&gt &lt/A>.</TT>


<H3>Syntax</H3>
<PRE>string.anchor(<I>name</I>)</PRE>
<P>The argument <I>name</I> can be any string.

<H3>Description</H3>
<P>xxx Description to be supplied.

<H3>Applies to</H3>
<P><A HREF="objects.html#string_object" tppabs="http://www.webjx.com/js/objects.html#string_object">string</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#link_method>link</A> method
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="asin_method"><H2>asin method</H2></A>
<P>
Returns the arc sine (in radians) of its argument.

<H3>Syntax</H3>
<PRE>asin(<I>arg</I>)</PRE>

<H3>Applies to</H3>
<P><A HREF="objects.html#Math_object" tppabs="http://www.webjx.com/js/objects.html#Math_object">Math</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#acos_method>acos</A>, <A HREF=#atan_method>atan</A>, <A HREF=#cos_method>cos</A>, <A HREF=#sin_method>sin</A>, <A HREF=#tan_method>tan</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="assign_method"><H2>assign method</H2></A>
<P>
Sets <b>location.href</b> so you don't have to type &quot.href" complements <b>toString()</b>.

<H3>Syntax</H3>
<PRE>assign()</PRE>

<H3>Description</H3>
<P>Do not call the assign method. It exists so you can use <TT>'location=...'</TT> instead of <TT>'location.href=...'</TT>.
<! xxx We put in Brendan's comments, but we need more information about the assign method so we can explain it properly. 

<P>xxx Description to be supplied.

<H3>Applies to</H3>
<P><A HREF="objects.html#location_object" tppabs="http://www.webjx.com/js/objects.html#location_object">location</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="atan_method"><H2>atan method</H2></A>
<P>
Returns the arc tangent (in radians) of its argument.

<H3>Syntax</H3>
<PRE>atan(<I>arg</I>)</PRE>

<H3>Applies to</H3>
<P><A HREF="objects.html#Math_object" tppabs="http://www.webjx.com/js/objects.html#Math_object">Math</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#acos_method>acos</A>, <A HREF=#asin_method>asin</A>, <A HREF=#cos_method>cos</A>, <A HREF=#sin_method>sin</A>, <A HREF=#tan_method>tan</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="back_method"><H2>back method</H2></A>
<P>
Loads the previous URL in the history list.

<H3>Syntax</H3>
<PRE>back()</PRE>

<H3>Description</H3>
<P>This method performs the same action as a user choosing the Back button in the Navigator. The back method is the same as <TT>go(-1)</TT>.

<H3>Applies to</H3>
<P><A HREF="objects.html#history_object" tppabs="http://www.webjx.com/js/objects.html#history_object">history</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#forward_method>forward</A>, <A HREF=#go_method>go</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="big_method"><H2>big method</H2></A>
<P>
Causes the calling string object to be displayed in big font by surrounding it with HTML big font tags, <TT> &ltBIG> and &lt/BIG>.</TT>


<H3>Syntax</H3>
<PRE>big()</PRE>

<H3>Description</H3>
<P>xxx Description to be supplied.

<H3>Applies to</H3>
<P><A HREF="objects.html#string_object" tppabs="http://www.webjx.com/js/objects.html#string_object">string</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#fontsize_method>fontsize</A>, <A HREF=#small_method>small</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="blink_method"><H2>blink method</H2></A>
<P>
Causes the calling string object to blink by surrounding it with HTML blink tags, <TT> &ltBLINK> ... &lt/BLINK>.</TT>


<H3>Syntax</H3>
<PRE>blink()</PRE>

<H3>Description</H3>
<P>xxx Description to be supplied.

<H3>Applies to</H3>
<P><A HREF="objects.html#string_object" tppabs="http://www.webjx.com/js/objects.html#string_object">string</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#bold_method>bold</A>, <A HREF=#italics_method>italics</A>, <A HREF=#strike_method>strike</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="blur_method"><H2>blur method</H2></A>
<P>
For password, text, and textArea, removes focus to the object.

<H3>Syntax</H3>
<PRE>blur()</PRE>

<H3>Description</H3>
<P>Use the blur method to remove focus from a specific form element.

<H3>Applies to</H3>
<P><A HREF="objects.html#password_object" tppabs="http://www.webjx.com/js/objects.html#password_object">password</A>, <A HREF="objects.html#text_object" tppabs="http://www.webjx.com/js/objects.html#text_object">text</A>, <A HREF="objects.html#textArea_object" tppabs="http://www.webjx.com/js/objects.html#textArea_object">textArea</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#focus_method>focus</A>, <A HREF=#select_method>select</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="bold_method"><H2>bold method</H2></A>
<P>
Causes the calling string object to be displayed as bold by surrounding it with HTML bold tags, <TT> &ltB> ... &lt/B>.</TT>


<H3>Syntax</H3>
<PRE>bold()</PRE>
<B>NOTE:</b> For Beta4, use B() for this method.

<H3>Description</H3>
<P>xxx Description to be supplied.

<H3>Applies to</H3>
<P><A HREF="objects.html#string_object" tppabs="http://www.webjx.com/js/objects.html#string_object">string</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#blink_method>blink</A>, <A HREF=#italics_method>italics</A>, <A HREF=#strike_method>strike</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="ceil_method"><H2>ceil method</H2></A>
<P>
Returns the least integer greater than or equal to its argument.

<H3>Syntax</H3>
<PRE>ceil(<I>arg</I>)</PRE>

<H3>Applies to</H3>
<P><A HREF="objects.html#Math_object" tppabs="http://www.webjx.com/js/objects.html#Math_object">Math</A>

<H3>Examples</H3>
<P>xxx Examples to be supplied.

<H3>See also</H3>
<LI><A HREF=#floor_method>floor</A> method
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="charAt_method"><H2>charAt method</H2></A>
<P>
Returns the character at the specified <I>index</I>.

<H3>Syntax</H3>
<PRE>charAt(<I>index</I>)</PRE>
<P><I>index</I> is any integer from 0 to string.length() - 1.

<H3>Description</H3>
<P>xxx Description to be supplied.

<H3>Applies to</H3>

⌨️ 快捷键说明

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