邮件订阅
5ucms模版,javascript手冊-e
作者: 来源: 日期:2015/9/2 2:40:17 浏览量:56(滞后) 人气:LOADING...(实时) 【

5ucms模版,javascript手冊-e

E property

Euler''s c has no effect.

The value of each element in the elements array is the full htm statement for the object.

Properties

  • length reflects the number of elements on a form

    例子

    See the 例子 for the name property.

    See also

  • form object

    elements property

    An array of objects corresponding to form elements (such as checkbox, radio, and text objects) in source order. See elements array.


    encoding property

    A string specifying the MIME encoding of the form.

    语法

    formName.encoding

    formName is either the name of a form or an element in the forms array.

    Property of

    form

    描述

    The encoding property initially reflects the ENCTYPE attribute of the <FORM> tag; however, setting encoding overrides the ENCTYPE attribute.

    You can set the encoding property at any time.

    Certain values of the encoding property may require specific values for other form properties. See RFC 1867 for more information.

    例子

    The following function returns the value of the musicForm encoding property:

    function getEncoding() {   return document.musicForm.encoding}

    See also

  • action, method, target properties

    escape function

    Returns the ASCII encoding of an argument in the ISO Latin-1 character set.

    语法

    escape("string")

    string is a non-alphanumeric string in the ISO Latin-1 character set, or a property of an existing object.

    描述

    The escape function is not a method associated with any object, but is part of the language itself.

    The value returned by the escape function is a string of the form "%xx", where xx is the ASCII encoding of a character in the argument. If you pass the escape function an alphanumeric character, the escape function returns the same character.

    例子

    The following example returns "%26"

    escape("&")

    The following example returns "%21%23"

    escape("!#")

    See also

  • unescape function

    eval function

    The eval function evaluates a string and returns a value.

    语法

    eval(string)
    string is any string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects.

    描述

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

    The argument of the eval function is a string. Do not call eval to evaluate an arithmetic expression. JavaScript evaluates arithmetic expressions automatically. If the argument represents an expression, eval evaluates the expression. If the argument represents one or more JavaScript statements, eval performs the statements.

    If you construct an arithmetic expression as a string, you can use eval to evaluate it at a later time. For example, suppose you have a variable x. You can postpone evaluation of an expression involving x by assigning the string value of the expression, say "3 * x + 2", to a variable, and then calling eval at a later point in your script.

    例子

    Example 1. Both of the write statements below display 42. The first evaluates the string "x + y + 1", and the second evaluates the string "42".

    var x = 2var y = 39var z = "42"document.write(eval("x + y + 1"), "<BR>") document.write(eval(z), "<BR>")

    Example 2. In the following example, the getFieldName(n) function returns the name of the nth form element as a string. The first statement assigns the string value of the third form element to the variable field. The second statement uses eval to display the value of the form element.

    var field = getFieldName(3) document.write("The field named ", field, " has value of ", eval(field + ".value"))

    Example 3. The following example uses eval to evaluate the string str. This string consists of JavaScript statements that opens an alert dialog box and assigns z a value of 42 if x is five, and assigns zero to z otherwise. When the second statement is executed, eval will cause these statements to be performed, and it will also evaluate the set of statements and return the value that is assigned to z.

    var str = "if (x == 5) {alert(''z is 42''); z = 42;} else z = 0; "document.write("<P>z is ", eval(str))

    Example 4. In the following example, the setValue() function uses eval to assign the value of the variable newValue to the text field textObject.

    function setValue (textObject, newValue) {  eval ("document.forms[0]." + textObject + ".value") = newValue}

    exp method

    Returns enumber, where number is the argument, and e is Euler''s constant, the base of the natural logarithms.

    语法

    Math.exp(number)
    number is any numeric expression or a property of an existing object.

    Method of

    Math

    例子

    //Displays the value 2.718281828459045document.write("The value of e<SUP>1</SUP> is " + Math.exp(1))

    See also

  • log, pow methods

  • 无忧CMS,5ucms.org建站仿站首选!

    本站推荐: 5ucms模板下载 5ucms插件下载 仿站联系Q3876307       [复制给好友] [打印] [关闭] [返回] [顶部]
    上一篇:5ucms仿站,javascript手冊总纲
    下一篇:5ucms教程,javascript手冊-t
    本站声明:本网站所载文章等内容,目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权及其它问题,请在30日内与本网联系(Email:3876307#qq.com),我们将在第一时间删除内容。若原创内容转载请注明出处。
    5ucms模版,javascript手冊-e的关键词:
    评论信息
    相关分类
    本周热门
    本月热门
    关于我们 - 版权/免责 申明 - 建站服务 - 网站地图 - 稿件投递 - 联系我们 - 5ucms
    Copyright © 2008-2015 www.5ucms.org