javascript手冊-p&q

原创 2001年08月27日 20:04:00

parent property

The parent property is a synonym for a window or frame whose frameset contains the current frame.

语法

1. parent.propertyName
2. parent.methodName
3. parent.frameName
4. parent.frames[index]

propertyName is the defaultStatus, status, length, name, or parent property when the calling parent refers to a window object.
propertyName is the length, name, or parent property when the calling parent refers to a frame object.
methodName is any method associated with the window object.
frameName and frames[index] are ways to refer to frames.

Property of

frame, window

Description

The parent property refers to the <FRAMESET> window of a frame. Child frames within a frameset refer to sibling frames by using "parent" in place of the window name as follows: parent.frameName or parent.frames[index]. For example, if the fourth frame in a set has NAME="homeFrame", sibling frames can refer to that frame using parent.homeFrame or parent.frames[3].

You can use parent.parent to refer to the "grandparent" frame or window when a <FRAMESET> tag is nested within a child frame.

The parent property is read-only. The value of the parent property is

     <object nameAttribute>
where nameAttribute is the NAME attribute if the parent is a frame, or an internal reference if the parent is a window.

例子

See the 例子 for the frame object.


parse method

Returns the number of milliseconds in a date string since January 1, 1970 00:00:00, local time.

语法

Date.parse(dateString)
dateString is a string representing a date or a property of an existing object.

Method of

Date

Description

The parse method takes a date string (such as "Dec 25, 1995"), and returns the number of milliseconds since January 1, 1970 00:00:00 (local time). This function is useful for setting date values based on string values, for example in conjunction with the setTime method and the Date object.

Given a string representing a time, parse returns the time value. It accepts the IETF standard date 语法: "Mon, 25 Dec 1995 13:30:00 GMT". It understands the continental US time zone abbreviations, but for general use, use a time zone offset, for example "Mon, 25 Dec 1995 13:30:00 GMT+0430" (4 hours, 30 minutes west of the Greenwich meridian). If you do not specify a time zone, the local time zone is assumed. GMT and UTC are considered equivalent.

Because the parse function is a static method of Date, you always use it as Date.parse(), rather than as a method of a date object you created.

例子

If IPOdate is an existing date object, then

IPOdate.setTime(Date.parse("Aug 9, 1995"))

相关

UTC method

parseFloat function

Parses a string argument and returns a floating point number.

语法

parseFloat(string)

string is a string that represents the value you want to parse.

Description

The parseFloat function is a built-in JavaScript function. It is not a method associated with any object, but is part of the language itself.

parseFloat parses its argument, a string, and returns a floating point number. If it encounters a character other than a sign ( + or -), numeral (0-9), a decimal point, or an exponent, then it returns the value up to that point and ignores that character and all succeeding characters.

If the first character cannot be converted to a number, parseFloat returns one of the following values:

0 on Windows platforms. "NaN" on any other platform, indicating that the value is not a number.

For arithmetic purposes, the "NaN" value is not a number in any radix. You can call the isNaN function to determine if the result of parseFloat is "NaN". If "NaN" is passed on to arithmetic operations, the operation results will also be "NaN".

例子

The following 例子 all return 3.14:

parseFloat("3.14")
parseFloat("314e-2")
parseFloat("0.0314E+2")
var x = "3.14"
parseFloat(x)

The following example returns "NaN" or 0:

parseFloat("FF2")

相关

isNaN, parseInt functions

parseInt function

Parses a string argument and returns an integer of the specified radix or base.

语法

parseInt(string [,radix])

string is a string that represents the value you want to parse.
radix is an integer that represents the radix of the return value.

Description

The parseInt function is a built-in JavaScript function. It is not a method associated with any object, but is part of the language itself.

The parseInt function parses its first argument, a string, and attempts to return an integer of the specified radix (base). For example, a radix of 10 indicates to convert to a decimal number, 8 octal, 16 hexadecimal, and so on. For radixes above 10, the letters of the alphabet indicate numerals greater than 9. For example, for hexadecimal numbers (base 16), A through F are used.

If parseInt encounters a character that is not a numeral in the specified radix, it ignores it and all succeeding characters and returns the integer value parsed up to that point. ParseInt truncates numbers to integer values.

If the radix is not specified or is specified as 0, JavaScript assumes the following:

If the input string begins with "0x", the radix is 16 (hexadecimal). If the input string begins with "0", the radix is 8 (octal). If the input string begins with any other value, the radix is 10 (decimal).

If the first character cannot be converted to a number, parseFloat returns one of the following values:

0 on Windows platforms. "NaN" on any other platform, indicating that the value is not a number.

For arithmetic purposes, the "NaN" value is not a number in any radix. You can call the isNaN function to determine if the result of parseInt is "NaN". If "NaN" is passed on to arithmetic operations, the operation results will also be "NaN".

例子

The following 例子 all return 15:

parseInt("F", 16)
parseInt("17", 8)
parseInt("15", 10)
parseInt(15.99, 10)
parseInt("FXX123", 16)
parseInt("1111", 2)
parseInt("15*3", 10)

The following 例子 all return "NaN" or 0:

parseInt("Hello", 8)
parseInt("0x7", 10)
parseInt("FFF", 10)

Even though the radix is specified differently, the following 例子 all return 17 because the input string begins with "0x".

parseInt("0x11", 16)
parseInt("0x11", 0)
parseInt("0x11")

相关

isNaN, parseFloat functions

password object

A text field on an htm form that conceals its value by displaying asterisks (*). When the user enters text into the field, asterisks (*) hide anything entered from view.

语法

To define a password object, use standard htm 语法:

<INPUT
   TYPE="password"
   NAME="passwordName"
   [VALUE="textValue"]
   SIZE=integer>
NAME="passwordName" specifies the name of the password object. You can access this value using the name property.
VALUE="textValue" specifies the initial value of the password object. You can access this value using the defaultValue property.
SIZE=integer specifies the number of characters the password object can accommodate without scrolling.

To use a password object's properties and methods:

1. passwordName.propertyName
2. passwordName.methodName(parameters)
3. formName.elements[index].propertyName
4. formName.elements[index].methodName(parameters)
passwordName is the value of the NAME attribute of a password object.
formName is either the value of the NAME attribute of a form object or an element in the forms array.
index is an integer representing a password object on a form.
propertyName is one of the properties listed below.
methodName is one of the methods listed below.

Property of

form

Description

A password object on a form looks as follows:

Enter your password:

A password object is a form element and must be defined within a <FORM> tag.

Properties

defaultValue reflects the VALUE attribute name reflects the NAME attribute value reflects the current value of the password object's field

Methods

focus blur select

Event handlers

None.

例子

Password:

相关

form and text objects

pathname property

A string specifying the url-path portion of the URL.

语法

1. links[index].pathname
2. location.pathname

index is an integer representing a link object.

Property of

link, location

Description

The pathname property specifies a portion of the URL. The pathname supplies the details of how the specified resource can be accessed.

You can set the pathname property at any time, although it is safer to set the href property to change a location. If the pathname that you specify cannot be found in the current location, you will get an error.

See Section 3.1 of RFC 1738 for complete information about the pathname.

例子

See the 例子 for the href property.

相关

hash, host, hostname, href, port, protocol, search properties

PI property

The ratio of the circumference of a circle to its diameter, approximately 3.14159.

语法

Math.PI

Property of

Math

Description

Because PI is a constant, it is a read-only property of Math.

例子

The following example displays the value of pi:

document.write("The value of pi is " + Math.PI)

相关

E, LN2, LN10, LOG2E, LOG10E, SQRT1_2, SQRT2 properties

port property

A string specifying the communications port that the server uses for communications.

语法

1. links[index].port
2. location.port

index is an integer representing a link object.

Property of

link, location

Description

The port property specifies a portion of the URL. The port property is a substring of the host property. The host property is the concatenation of the hostname and port properties, separated by a colon. When the port property is not defined, the host property is the same as the hostname property.

You can set the port property at any time, although it is safer to set the href property to change a location. If the port that you specify cannot be found in the current location, you will get an error. If the port property is not specified, it defaults to 80 on the server.

See Section 3.1 of RFC 1738 for complete information about the port.

例子

See the 例子 for the href property.

相关

hash, host, hostname, href, pathname, protocol, search properties

pow method

Returns base to the exponent power, that is, baseexponent.

语法

Math.pow(base, exponent)
base is any numeric expression or a property of an existing object.
exponent is any numeric expression or a property of an existing object. If the result would include an imaginary number (for example pow(-1, 0.5)), then the value returned is always zero.

Method of

Math

例子

//Displays the value 49
document.write("7 to the power of 2 is " + Math.pow(7,2))

//Displays the value 1024
document.write("<P>2 to the power of 10 is " + Math.pow(2,10))

相关

exp, log methods

prompt method

Displays a Prompt dialog box with a message and an input field.

语法

prompt(message, [inputDefault])
message is any string or a property of an existing object; the string is displayed as the message.
inputDefault is a string, integer, or property of an existing object that represents the default value of the input field.

Method of

window

Description

Use the prompt method to display a dialog box that receives user input. If you do not specify an initial value for inputDefault, the dialog box displays the value <undefined>.

Although prompt is a method of the window object, you do not need to specify a windowReference when you call it. For example, windowReference.prompt() is unnecessary.

例子

prompt("Enter the number of cookies you want to order:", 12)

相关

alert, confirm methods

protocol property

A string specifying the beginning of the URL, up to and including the first colon.

语法

1. links[index].protocol
2. location.protocol

index is an integer representing a link object.

Property of

link, location

Description

The protocol property specifies a portion of the URL. The protocol indicates the access method of the URL. For example, a protocol of "http:" specifies Hypertext Transfer Protocol, and a protocol of "javascript:" specifies JavaScript code.

You can set the protocol property at any time, although it is safer to set the href property to change a location. If the protocol that you specify cannot be found in the current location, you will get an error.

The protocol property represents the scheme name of the URL. See Section 2.1 of RFC 1738 for complete information about the protocol.

例子

See the 例子 for the href property.

相关

hash, host, hostname, href, pathname, port, search properties

时间序列ARMA中p,q选择

最近工作中用到时间序列模型中的ARMA(ARIMA),需要自动选择p,q值,但是我查到的资料都是根据自相关图和偏自相关图来观察拖尾和截尾,以此来选择p,q值,刚开始时一筹莫展,后来灵机一动,为何不看下...
  • xiaodongxiexie
  • xiaodongxiexie
  • 2017年01月20日 19:22
  • 3593

ARMA(模型)的p,q参数判定

AR(p)模型与MA(q)实际上是ARMA(p,q)模型的特例。它们都统称为ARMA模型,而ARMA(p,q)模型的统计性质也是AR(p)与MA(q)模型的统计性质的有机组合。平稳系列建模假如某个观察...
  • dingming001
  • dingming001
  • 2017年06月21日 19:23
  • 1844

R-ARMA(p,q)如何选找最小AIC的p,q值

RCode; #ARMA Modeling寻找AIC值最小的p,q armaSearch      armacoef      for (p in 0:5){          for ...
  • u012543538
  • u012543538
  • 2014年08月18日 17:41
  • 4772

IM6Q yocto开发平台搭建,学习FREESCALE官方手册笔记

本文文档是freescale手册fsl-yocto-3.14.28-1.0.0.tar.gz的学习笔记,资源以上传到csdn上了,免积分下载. 1.主机环境搭建,各种安装, (1)安装主机环境,以下部...
  • srf1986
  • srf1986
  • 2015年10月05日 19:55
  • 1485

Q4M使用手册

Q4M (queue for mysql) 是开源的实现队列功能的工作于MySQL5.1版本下的存储引擎,目前最高版本仅支持mysql 5.1版本。 一、概述 1. Q4M模型 是基于M...
  • xtjsxtj
  • xtjsxtj
  • 2013年11月29日 15:45
  • 1735

P4S_642-892_v3.00_updated84Q.pdf

  • 2010年02月18日 03:03
  • 9.54MB
  • 下载

黑苹果p5q主板专用声卡驱动

  • 2013年06月18日 22:02
  • 1.2MB
  • 下载

P5Q PRO 2012版本BIOS含SLIC2.1

  • 2013年02月04日 11:28
  • 1024KB
  • 下载

交叉熵H(p||q)代价函数

转载地址:http://blog.csdn.net/u012162613/article/details/44239919 本文是《Neural networks and deep ...
  • Twenty_seven
  • Twenty_seven
  • 2017年03月09日 10:23
  • 188

802.1p 802.1q是什么协议

一、802.1Q协议 802.1Q协议,即Virtual Bridged Local Area Networks协议,主要规定了VLAN的实现,下面我们首先讲述一下有关VLAN的基本观念。 二、...
  • stonesharp
  • stonesharp
  • 2011年11月23日 15:33
  • 4410
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:javascript手冊-p&q
举报原因:
原因补充:

(最多只允许输入30个字)