javascript使用全集2
javascript使用全集2
2011年04月08日
3.3 写出字符串
document.write("");
3.2 document.from
指定 表单域
3.1 document.all.id
查找指定 HTML 页面 ID 或 名字
3. document
2.2 转到特定网页
onClick="location.href=' http://127.0.0.1/'"
2.1 单独 location
取页面地址
2. location
1.4 this.height
取高度属性
1.3 this.width
取宽度属性
1.2 this.href
取链接地址
1.1 this.src
取图片地址
1. this
---/---------------------------------------------- -----------
问题集:
3. return 返回多个值 2006-10-14 14:13:18
2. 理解 setInternal 用法
1. 理解 void 用法
---/---------------------------------------------- -----------
相关摘要:
24. Keep in mind that the function statement is available in all versions of JavaScript, the Function( ) constructor is available only in JavaScript 1.1 and later, and function literals are available only in JavaScript 1.2 and later. Recall that we said the three functions defined earlier are "more or less" equivalent -- there are some differences between these three techniques for function definition, which we'll consider in Section 11.5.
//JavaScript: The Definitive Guide, 4th Edition -- 7.1.3 Function Literals
2006-10-19 14:35:56
23. The Function( ) constructor expects any number of string arguments. The last argument is the body of the function -- it can contain arbitrary JavaScript statements, separated from each other by semicolons. All other arguments to the constructor are strings that specify the names of the parameters to the function being defined. If you are defining a function that takes no arguments, you simply pass a single string -- the function body -- to the constructor.
//JavaScript: The Definitive Guide, 4th Edition -- 7.1.2 The Function( ) Constructor
2006-10-19 14:16:18
22. Note that ECMAScript v3 does not allow function definitions to appear anywhere; they are still restricted to top-level global code and top-level function code. This means that function definitions may not appear within loops or conditionals, for example.[1] These restrictions on function definitions apply only to function declarations with the function statement. As we'll discuss later in this chapter, function literals (another feature introduced in JavaScript 1.2 and standardized by ECMAScript v3) may appear within any JavaScript e??xpression, which means that they can appear within if and other statements.
//JavaScript: The Definitive Guide, 4th Edition -- 7.1 Defining and Invoking Functions
2006-10-19 14:10:13
21. try and finally can be used together without a catch clause. In this case, the finally block is simply cleanup code that is guaranteed to be executed, regardless of any break, continue, or return statements within the try clause. For example, the following code uses a try/finally statement to ensure that a loop counter variable is incremented at the end of each iteration, even when an iteration terminates abruptly because of a continue statement:
//JavaScript: The Definitive Guide, 4th Edition -- 6.17 try/catch/finally
2006-10-18 19:18:08
20. The continue statement, in both its labeled and unlabeled forms, can be used only within the body of a while, do/while, for, or for/in loop. Using it anywhere else causes a syntax error.
//JavaScript: The Definitive Guide, 4th Edition -- 6.12 continue
2006-10-18 16:03:46
19. The following rules are used to determine whether two values are identical according to the === operator:
If the two values have different types, they