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

📄 methods.html

📁 一个经典的例子
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<P>
where <code>dateObj</code> is a date object.

<H3>Description</H3>
<P>
Sets the year in the current date. Takes as its argument an integer greater than 1900.

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

<H3>Examples</H3>
<PRE>
theBigDay.setYear(96)
</PRE>

<H3>See also</H3>
<LI>xxx To be supplied.
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="sin_method"><H2>sin method</H2></A>
<P>
Returns the sine of its argument. The argument is in radians.

<H3>Syntax</H3>
<PRE>sin(<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=#atan_method>atan</A>, <A HREF=#cos_method>cos</A>, <A HREF=#tan_method>tan</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="small_method"><H2>small method</H2></A>
<P>
Causes the calling string object to be displayed in small font by surrounding it with HTML small font tags, <TT> &ltSMALL>...</SMALL>.</TT>


<H3>Syntax</H3>
<PRE>small()</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=#big_method>big</A>, <A HREF=#fontsize_method>fontsize</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="sqrt_method"><H2>sqrt method</H2></A>
<P>
Returns the square root of its argument.

<H3>Syntax</H3>
<PRE>sqrt(<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=#pow_method>pow</A> method
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="strike_method"><H2>strike method</H2></A>
<P>
Causes the calling string object to be displayed as struck out text, by surrounding it with HTML strikeout tags, <TT> &ltSTRIKE> ... &lt/STRIKE>.</TT>


<H3>Syntax</H3>
<PRE>strike()</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=#blink_method>blink</A>, <A HREF=#bold_method>bold</A>, <A HREF=#italics_method>italics</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="sub_method"><H2>sub method</H2></A>
<P>
Causes the calling string object to be displayed as a subscript by surrounding it with HTML subscript tags, <TT> &ltSUB> ... &lt/SUB>.</TT>


<H3>Syntax</H3>
<PRE>sub()</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.

<P><A HREF=#sup_method>sup</A> method
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="submit_method"><H2>submit method</H2></A>
<P>
Submits the form.

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

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

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

<H3>Examples</H3>
<P>xxx Examples to be supplied.
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="substring_method"><H2>substring method</H2></A>
<P>
The substring method returns a subset of a string object. If <TT>a &lt b</TT>, then it returns the subset starting at character a and ending before character b, considering the first character of the string to be character zero (0). If <TT>a &gt b</TT>, then it returns the subset starting at character b and ending at character a. If <TT>a = b</TT>, then it returns the empty string.

<H3>Syntax</H3>
<PRE>substring(<I>a</I>, <I>b</I>)</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>If string x is &quotnetscape" then <TT>x.substring(0,3)</TT> or <TT>x.substring(3,0)</TT> returns &quotnet", and <TT>x.substring(4,7) or x.substring(7,4)</TT> returns &quotcap".

<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="sup_method"><H2>sup method</H2></A>
<P>
Causes the calling string object to be displayed as a superscript by surrounding it with HTML superscript tags, <TT> &ltSUP> ... &lt/SUP>.</TT>


<H3>Syntax</H3>
<PRE>sup()</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=#sub_method>sub</A> method
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="tan_method"><H2>tan method</H2></A>
<P>
Returns the tangent of its argument. The argument is in radians.

<H3>Syntax</H3>
<PRE>tan(<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=#atan_method>atan</A>, <A HREF=#cos_method>cos</A>, <A HREF=#sin_method>sin</A> methods

<!----------------------------------------------------------------->
<HR>
<A NAME="toGMTString_method"><H2>toGMTString method</H2></A>

<H3>Syntax</H3>
<CODE>dateObj.toGMTString()</CODE>
<P>
where <code>dateObj</code> is a date object.

<H3>Description</H3>
<P>
Converts a date to a String, using the Internet GMT conventions. 

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

<H3>Examples</H3>

<PRE>
today.toGMTString()
</PRE>
<P>
If today is a date object, then toGMTString would convert the date to
GMT (UTC) using the operating system's time zone offset, and return a string
value in the following form:
<BR>
Mon, 18 Dec 1995 17:28:35 GMT

<!----------------------------------------------------------------->
<HR>
<A NAME="toLocaleString_method"><H2>toLocaleString method</H2></A>

<H3>Syntax</H3>
<CODE>dateObj.toLocaleString()</CODE>
<P>
where <code>dateObj</code> is a date object.

<H3>Description</H3>
<P>
Converts a date to a String, using the locale conventions. 

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

<H3>Examples</H3>

<PRE>
today.toLocaleString()
</PRE>
<P>
If today is a date object, then toLocaleString will return a string value
in the following form:
<BR>
12/18/95 17:28:35

<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="toLowerCase_method"><H2>toLowerCase method</H2></A>
<P>
The <I>toLowerCase</I> method of string objects converts the string to all upper case.

<H3>Syntax</H3>
<PRE>toLowerCase()</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>For example, <TT>&quotALPHABET".toLowerCase</TT> yields &quotalphabet".


<H3>See also</H3>
<LI><A HREF=#toUpperCase_method>toUpperCase</A> method
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="toString_method"><H2>toString method</H2></A>
<P>
For location, returns <b>location.href</b>, so you can use <b>location</b> as a string 
without typing &quot.href". For Date, converts a date to a string.

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

<H3>Description</H3>
<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>, <A HREF="objects.html#Date_object" tppabs="http://www.webjx.com/js/objects.html#Date_object">Date</A> methods

<H3>Examples</H3>
<P>
Here is an example of using toString with a date object, assuming theBigDay is a date object:

<PRE>
theBigDay.toString()
</PRE>
<P>
<i>More Examples to be supplied.</i>
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="toUpperCase_method"><H2>toUpperCase method</H2></A>
<P>
The <I>toUpperCase</I> method of string objects converts the string to all upper case.

<H3>Syntax</H3>
<PRE>toUpperCase()</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>For example, <TT>&quotalphabet".toUpperCase</TT> yields &quotALPHABET".


<H3>See also</H3>
<LI><A HREF=#toLowerCase_method>toLowerCase</A> method

<!----------------------------------------------------------------->
<HR>
<A NAME="UTC_method"><H2>UTC method</H2></A>

<H3>Syntax</H3>
<CODE>Date.UTC(<i>year, month, mday [, hrs] [, min] [, sec]</i>)</CODE>

<H3>Description</H3>
<P>
UTC takes comma-delimited date parameters and returns the number
of milliseconds since January 1, 1970 00:00:00, Universal Coordinated Time (GMT).

The arameters are: 
<UL>
<LI>year - a year after 1900 
<LI>month - a month between 0-11 
<LI>date - day of the month between 1-31 
<LI>hrs - hours between 0-23 
<LI>min - minutes between 0-59 
<LI>sec - seconds between 0-59 
</UL>

<P>
UTC is a static method of Date.  That means that you always use it as
<code>Date.UTC()</code>, rather than as a method of a date object you created.

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

<H3>Examples</H3>
<P>
The following statement creates a date object using GMT instead of local time:

<PRE>
gmtDate = new Date(Date.UTC(96, 11, 1, 0, 0, 0))
</PRE>

<H3>See also</H3>
<LI><A HREF=#parse_method>parse</A> method

<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="write_method"><H2>write method</H2></A>
<P>
Write HTML to the current window, in sequence with the HTML containing this SCRIPT. SCRIPTs have no effect on paragraphs or other structures in which they may occur.

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

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

<H3>Applies to</H3>
<P><A HREF="objects.html#document_object" tppabs="htt

⌨️ 快捷键说明

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