📄 ref_a-c.htm
字号:
<P>appCodeName is a read-only property.
<P>
<H3>例子</H3>
<P>The following example displays the value of the appCodeName property:
<PRE>document.write("The value of navigator.appCodeName is " +
navigator.appCodeName)</PRE>
<P>For Navigator 2.0, this displays the following:
<PRE>The value of navigator.appCodeName is Mozilla</PRE>
<H3>See also</H3>
<LI><A HREF="ref_a-c.htm#appName_property" appName_property">appName</A>, <A HREF="ref_a-c.htm#appVersion_property" appVersion_property">appVersion</A>, <A HREF="ref_t-z.htm#userAgent_property" userAgent_property">userAgent</A> properties
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="appName_property"><H2>appName property</H2></A>
<P>
A string specifying the name of the browser.
<H3>语法</H3>
<PRE>navigator.appName</PRE>
<H3>Property of</H3>
<P><A HREF="ref_m-q.htm#navigator_object" navigator_object">navigator</A>
<H3>描述</H3>
<P>appName is a read-only property.
<H3>例子</H3>
<P>The following example displays the value of the appName property:
<PRE>document.write("The value of navigator.appName is " +
navigator.appName)</PRE>
<P>For Navigator 2.0, this displays the following:
<PRE>The value of navigator.appName is Netscape</PRE>
<H3>See also</H3>
<LI><A HREF="ref_a-c.htm#appVersion_property" appVersion_property">appVersion</A>, <A HREF="ref_a-c.htm#appCodeName_property" appCodeName_property">appCodeName</A>, <A HREF="ref_t-z.htm#userAgent_property" userAgent_property">userAgent</A> properties
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="appVersion_property"><H2>appVersion property</H2></A>
<P>
A string specifying version information for the Navigator.
<H3>语法</H3>
<PRE>navigator.appVersion</PRE>
<H3>Property of</H3>
<P><A HREF="ref_m-q.htm#navigator_object" navigator_object">navigator</A>
<H3>描述</H3>
<P>The appVersion property specifies version information in the following format:
<P><I>releaseNumber</I> (<I>platform</I>; <I>country</I>)
<P>The values contained in this format are the following:
<LI><I>releaseNumber</I> is the version number of the Navigator. For example, "2.0b4" specifies Navigator 2.0, beta 4.
<LI><I>platform</I> is the platform upon which the Navigator is running. For example, "Win16" specifies a 16-bit version of Windows such as Windows 3.11.
<LI><I>country</I> is either "I" for the international release, or "U" for the domestic U.S. release. The domestic release has a stronger encryption feature than the international release.
<P>appVersion is a read-only property.
<H3>例子</H3>
<P><B>Example 1.</B> The following example displays version information for the Navigator:
<PRE>document.write("The value of navigator.appVersion is " +
navigator.appVersion)</PRE>
<P>For Navigator 2.0 on Windows 95, this displays the following:
<PRE>The value of navigator.appVersion is 2.0 (Win95, I)</PRE>
<P><B>Example 2.</B> The following example populates a textarea object with newline characters separating each line. Because the newline character varies from platform to platform, the example tests the appVersion property to determine whether the user is running Windows (appVersion contains "Win" for all versions of Windows). If the user is running Windows, the newline character is set to \r\n; otherwise, it's set to \n, which is the newline character for Unix and Macintosh.
<XMP>
<SCRIPT>
var newline=null
function populate(textareaObject){
if (navigator.appVersion.lastIndexOf('Win') != -1)
newline="\r\n"
else newline="\n"
textareaObject.value="line 1" + newline + "line 2" + newline + "line 3"
}
</SCRIPT>
<FORM NAME="form1">
<BR><TEXTAREA NAME="testLines" ROWS=8 COLS=55></TEXTAREA>
<P><INPUT TYPE="button" VALUE="Populate the textarea object"
onClick="populate(document.form1.testLines)">
</TEXTAREA>
</FORM>
</XMP>
<H3>See also</H3>
<LI><A HREF="ref_a-c.htm#appName_property" appName_property">appName</A>, <A HREF="ref_a-c.htm#appCodeName_property" appCodeName_property">appCodeName</A>, <A HREF="ref_t-z.htm#userAgent_property" userAgent_property">userAgent</A> properties
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="asin_method"><H2>asin method</H2></A>
<P>
Returns the arc sine (in radians) of a number.
<H3>语法</H3>
<PRE>Math.asin(<I>number</I>)</PRE>
<P><I>number</I> is a numeric expression between -1 and 1, or a property of an existing object.
<H3>用法</H3>
<P><A HREF="ref_m-q.htm#Math_object" Math_object">Math</A>
<H3>描述</H3>
<P>The asin method returns a numeric value between -pi/2 and pi/2 radians. If the value of <I>number</I> is outside the suggested range, the return value is always 0.
<H3>例子</H3>
<PRE>
// Displays the value 1.570796326794897 (pi/2)
document.write("The arc sine of 1 is " + Math.asin(1))
// Displays the value -1.570796326794897 (-pi/2)
document.write("<P>The arc sine of -1 is " + Math.asin(-1))
// Displays the value 0 because the argument is out of range
document.write("<P>The arc sine of 2 is " + Math.asin(2))
</PRE>
<H3>See also</H3>
<LI><A HREF="ref_a-c.htm#acos_method" acos_method">acos</A>, <A HREF="ref_a-c.htm#atan_method" atan_method">atan</A>, <A HREF="ref_a-c.htm#cos_method" cos_method">cos</A>, <A HREF="ref_s-s.htm#sin_method" sin_method">sin</A>, <A HREF="ref_t-z.htm#tan_method" tan_method">tan</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="atan_method"><H2>atan method</H2></A>
<P>
Returns the arc tangent (in radians) of a number.
<H3>语法</H3>
<PRE>Math.atan(<I>number</I>)</PRE>
<P><I>number</I> is either a numeric expression or a property of an existing object, representing the tangent of an angle.
<H3>用法</H3>
<P><A HREF="ref_m-q.htm#Math_object" Math_object">Math</A>
<H3>描述</H3>
<P>The atan method returns a numeric value between -pi/2 and pi/2 radians.
<H3>例子</H3>
<PRE>
// Displays the value 0.7853981633974483
document.write("The arc tangent of 1 is " + Math.atan(1))
// Displays the value -0.7853981633974483
document.write("<P>The arc tangent of -1 is " + Math.atan(-1))
// Displays the value 0.4636476090008061
document.write("<P>The arc tangent of .5 is " + Math.atan(.5))
</PRE>
<H3>See also</H3>
<LI><A HREF="ref_a-c.htm#acos_method" acos_method">acos</A>, <A HREF="ref_a-c.htm#asin_method" asin_method">asin</A>, <A HREF="ref_a-c.htm#cos_method" cos_method">cos</A>, <A HREF="ref_s-s.htm#sin_method" sin_method">sin</A>, <A HREF="ref_t-z.htm#tan_method" 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>语法</H3>
<PRE>history.back()</PRE>
<H3>用法</H3>
<P><A HREF="ref_h-l.htm#history_object" history_object">history</A>
<H3>描述</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>history.go(-1)</TT>.
<H3>例子</H3>
The following custom buttons perform the same operations as the Navigator Back and Forward buttons:
<PRE>
<P><INPUT TYPE="button" VALUE="< Back"
onClick="history.back()">
<P><INPUT TYPE="button" VALUE="> Forward"
onClick="history.forward()">
</PRE>
<H3>See also</H3>
<LI><A HREF="ref_f-g.htm#forward_method" forward_method">forward</A>, <A HREF="ref_f-g.htm#go_method" go_method">go</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="bgColor_property"><H2>bgColor property</H2></A>
<P>
A string specifying the color of the document background.
<H3>语法</H3>
<PRE>document.bgColor</PRE>
<H3>Property of</H3>
<P><A HREF="ref_d-e.htm#document_object" document_object">document</A>
<H3>描述</H3>
<P>The bgColor property is expressed as a hexadecimal RGB triplet or as one of the string literals listed in <A HREF="tppmsgs/msgs0.htm#11" tppabs="http://www.nease.net/~jim/colors.htm">Color Values</A>. This property is the JavaScript reflection of the BGCOLOR attribute of the <BODY> tag. The default value of this property is set by the user on the Colors tab of the Preferences dialog box, which is displayed by choosing General Preferences from the Options menu.
<P>You can set the bgColor property at any time.
<P>If you express the color as a hexadecimal RGB triplet, you must use the format rrggbb. For example, the hexadecimal RGB values for salmon are red=FA, green=80, and blue=72, so the RGB triplet for salmon is "FA8072".
<H3>例子</H3>
<P>The following example sets the color of the document background to aqua using a string literal:
<PRE>
document.bgColor="aqua"
</PRE>
<P>The following example sets the color of the document background to aqua using a hexadecimal triplet:
<PRE>
document.bgColor="00FFFF"
</PRE>
<H3>See also</H3>
<LI><A HREF="ref_a-c.htm#alinkColor_property" alinkColor_property">alinkColor</A>, <A HREF="ref_f-g.htm#fgColor_property" fgColor_property">fgColor</A>, <A HREF="ref_h-l.htm#linkColor_property" linkColor_property">linkColor</A>, and <A HREF="ref_t-z.htm#vlinkColor_property" vlinkColor_property">vlinkColor</A> properties
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="big_method"><H2>big method</H2></A>
<P>
Causes a string to be displayed in a big font as if it were in a <BIG> tag.
<H3>语法</H3>
<PRE><I>stringName</I>.big()</PRE>
<P><I>stringName</I> is any string or a property of an existing object.
<H3>用法</H3>
<P><A HREF="ref_s-s.htm#string_object" string_object">string</A>
<H3>描述</H3>
<P>Use the big method with the write or writeln methods to format and display a string in a document.
<H3>例子</H3>
The following example uses string methods to change the size of a string:
<PRE>
var worldString="Hello, world"
document.write(worldString.small())
document.write("<P>" + worldString.big())
document.write("<P>" + worldString.fontsize(7))
</PRE>
<P>The previous example produces the same output as the following htm:
<XMP>
<SMALL>Hello, world</SMALL>
<P><BIG>Hello, world</BIG>
<P><FONTSIZE=7>Hello, world</FONTSIZE>
</XMP>
<H3>See also</H3>
<LI><A HREF="ref_f-g.htm#fontsize_method" fontsize_method">fontsize</A>, <A HREF="ref_s-s.htm#small_method" small_method">small</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="blink_method"><H2>blink method</H2></A>
<P>
Causes a string to blink as if it were in a <BLINK> tag.
<H3>语法</H3>
<PRE><I>stringName</I>.blink()</PRE>
<P><I>stringName</I> is any string or a property of an existing object.
<H3>用法</H3>
<P><A HREF="ref_s-s.htm#string_object" string_object">string</A>
<H3>描述</H3>
<P>Use the blink method with the write or writeln methods to format and display a string in a document.
<H3>例子</H3>
The following example uses string methods to change the formatting of a string:
<PRE>
var worldString="Hello, world"
document.write(worldString.blink())
document.write("<P>" + worldString.bold())
document.write("<P>" + worldString.italics())
document.write("<P>" + worldString.strike())
</PRE>
<P>The previous example produces the same output as the following htm:
<XMP>
<BLINK>Hello, world</BLINK>
<P><B>Hello, world</B>
<P><I>Hello, world</I>
<P><STRIKE>Hello, world</STRIKE>
</XMP>
<H3>See also</H3>
<LI><A HREF="ref_a-c.htm#bold_method" bold_method">bold</A>, <A HREF="ref_h-l.htm#italics_method" italics_method">italics</A>, <A HREF="ref_s-s.htm#strike_method" strike_method">strike</A> methods
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="blur_method"><H2>blur method</H2></A>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -