分享
 
 
 

javascript手冊-l

王朝java/jsp·作者佚名  2006-12-17
窄屏简体版  字體: |||超大  

javascript手冊-l

javascript手冊-l Choose a destination from the following list, then click "Click me" below.

Netscape home page

Sun home page

RFC 1867 Click meExample 5: links array. The following example opens the Netscape home page in the newWindow window. The linkGetter() function uses the links array to display the value of each of its links. newWindow=window.open("http://www.netscape.com")function linkGetter() { msgWindow=window.open("") for (var i = 0; i

") }}相关anchor object link method linkColor propertyA string specifying the color of the document hyperlinks. 语法document.linkColor

Property ofdocument 描述The linkColor property is expressed as a hexadecimal RGB triplet or as one of the string literals listed in Color Values. This property is the JavaScript reflection of the LINK 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. You cannot set this property after the htm source has been through layout. 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". 例子The following example sets the color of document links to aqua using a string literal: document.linkColor="aqua"

The following example sets the color of document links to aqua using a hexadecimal triplet: document.linkColor="00FFFF"

相关alinkColor, bgColor, fgColor, and vlinkColor properties links propertyAn array of objects corresponding to link objects in source order. See link object. LN2 propertyThe natural logarithm of two, approximately 0.693. 语法Math.LN2

Property ofMath 描述Because LN2 is a constant, it is a read-only property of Math. 例子The following example displays the natural log of 2: document.write("The natural log of 2 is " + Math.LN2)

相关E, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2 properties LN10 propertyThe natural logarithm of ten, approximately 2.302. 语法Math.LN10

Property ofMath 描述Because LN10 is a constant, it is a read-only property of Math. 例子The following example displays the natural log of 10: document.write("The natural log of 10 is " + Math.LN10)

相关E, LN2, LOG2E, LOG10E, PI, SQRT1_2, SQRT2 properties location objectContains information on the current URL. 语法To use a location object: [windowReference.]location[.propertyName]

windowReference is a variable windowVar from a window definition (see window object), or one of the synonyms top or parent.

propertyName is one of the properties listed below. Omitting the property name is equivalent to specifying the href property (the complete URL). Property ofwindow 描述The location object represents a complete URL. Each property of the location object represents a different portion of the URL. The following diagram of a URL shows the relationships between the location properties: protocol//hostname:port pathname search hash

protocol represents the beginning of the URL, up to and including the first colon.

hostname represents the host and domain name, or IP address, of a network host.

port represents the communications port that the server uses for communications.

pathname represents the url-path portion of the URL.

search represents any query information in the URL, beginning with a question mark.

hash represents an anchor name fragment in the URL, beginning with a hash mark (#). See the properties (listed below) for details about the different parts of the URL, or the href property for 例子. The location object has two other properties not shown in the diagram above: href represents a complete URL.

host represents the concatenation hostname:port. The location object is contained by the window object and is within its scope. If you reference a location object without specifying a window, the location object represents the current location. If you reference a location object and specify a window name, for example, windowReference.location.propertyName, the location object represents the location of the specified window. Do not confuse the location object with the location property of the document object. You cannot change the value of the location property (document.location), but you can change the value of the location object's properties (window.location.propertyName). document.location is a string-valued property that usually matches what window.location.href is set to when you load the document, but redirection may change it. 语法 for common URL typesWhen you specify a URL, you can use standard URL formats and JavaScript statements. The following list shows the 语法 for specifying some of the most common types of URLs. URL typeProtocolExampleJavaScript code

javascript:

javascript:history.go(-1)

Navigator info

about:

about:cache

World Wide Web

http:

http://www.netscape.com/

File

file:

file:///javascript/methods.htm

FTP

ftp:

ftp://ftp.mine.com/home/mine

MailTo

mailto:

mailto:info@netscape.com

Usenet

news:

news://news.scruznet.com/comp.lang.javascript

Gopher

gopher:

gopher.myhost.com

The javascript: protocol evaluates the expression after the colon (:), if there is one, and loads a page containing the string value of the expression, unless it is undefined. If the expression evaluates to undefined, no new page loads. The about: protocol provides information on Navigator and has the following 语法: about:[cache|plugins]

about: by itself is the same as choosing About Netscape from the Navigator's Help menu.

about:cache displays disk cache statistics.

about:plug-ins displays information about plug-ins you have configured. This is the same as choosing About Plug-ins from the Navigator's Help menu. Propertieshash specifies an anchor name in the URL host specifies the hostname:port portion of the URL hostname specifies the host and domain name, or IP address, of a network host href specifies the entire URL pathname specifies the url-path portion of the URL port specifies the communications port that the server uses for communications protocol specifies the beginning of the URL, including the colon search specifies a query MethodsNone. Event handlersNone. 例子Example 1. The following two statements are equivalent and set the URL of the current window to the Netscape home page: window.location.href="http://www.netscape.com/"window.location="http://www.netscape.com/"Example 2. The following statement sets the URL of a frame named frame2 to the Sun home page: parent.frame2.location.href="http://www.sun.com/"相关 the example for the anchor object. 相关history object location property location propertyA string specifying the complete URL of the document. 语法document.location

Property ofdocument 描述Do not confuse the location property of the document object with the location object. You cannot change the value of the location property (document.location), but you can change the value of the location object's properties (window.location.propertyName). document.location is a string-valued property that usually matches what window.location.href is set to when you load the document, but redirection may change it. location is a read-only property of document. 例子The following example displays the URL of the current document: document.write("The current URL is " + document.location)

相关location object log methodReturns the natural logarithm (base e) of a number. 语法Math.log(number)

number is any positive numeric expression or a property of an existing object. Method ofMath 描述If the value of number is outside the suggested range, the return value is always -1.797693134862316e+308. 例子//Displays the value 2.302585092994046document.write("The natural log of 10 is " + Math.log(10))//Displays the value 0document.write("<P>The natural log of 1 is " + Math.log(1))//Displays the value -1.797693134862316e+308//because the argument is out of rangedocument.write("<P>The natural log of 0 is " + Math.log(0))

相关exp, pow methods LOG2E propertyThe base 2 logarithm of e (approximately 1.442). 语法Math.LOG2E

Property ofMath 描述Because LOG2E is a constant, it is a read-only property of Math. 例子The following example displays the base 2 logarithm of E: document.write("The base 2 logarithm of E is " + Math.LOG2E)

相关E, LN2, LN10, LOG10E, PI, SQRT1_2, SQRT2 properties LOG10E propertyThe base 10 logarithm of e (approximately 0.434). 语法Math.LOG10E

Property ofMath 描述Because LOG10E is a constant, it is a read-only property of Math. 例子The following example displays the base 10 logarithm of E: document.write("The base 10 logarithm of E is " + Math.LOG10E)

相关E, LN2, LN10, LOG2E, PI, SQRT1_2, SQRT2 properties

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有