学习【JavaScript权威指南】(一)

本文深入探讨JavaScript的基础语法、对象操作、原型链理解、数学运算、字符串处理、数组方法及函数特性,涵盖闭包、作用域、类型转换、序列化、数组操作及函数编程技巧。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

不看不得了,一看吓一跳。。。好多简单的东西都不懂的,写个 $(function(){   } );   还需要查询下才记起来。。。

var book = {
   topic: "Javascript",
   fat: true   //true, false布尔值 null为空  undefined为未定义
}
book.author = "why-su"; //通过赋值创建一个新属性
book.content = {};  //{} 是一个空对象
book.plus = function(){  //定义一个方法
   return this.topic;    //this对自己的引用
} 
book.plus(); //执行方法

关于prototype的理解:https://www.cnblogs.com/loveyoume/p/6112044.html  ( prototype 这个属性是函数特有的属性 ,而且是函数的原型对象。对原型对象增加的属性及其方法,new实例化 之后的对象都能继承。)

    function Point(x,y) {
        this.x = x;
        this.y = y;
    }
    Point.prototype.z = function () {
        return Math.sqrt(this.x * this.x + this.y*this.y);
    };
    var p = new Point(3,4);  
    alert(p.z());   //结果是 5

隐藏,但保留空间  this.style.visibility = "hidden"

隐藏,不保留空间 this.style.display = "none"

Math的函数多多少少也要给我记住一些:

Math.pow(2,53);   //2的53次方
Math.sqrt(4); //4的平方根
Math.pow(8,1/3); //8的立方根
Math.ceil(.3); //向上取整
Math.floor(.3); //向下取整
Math.ceil(.3); //四舍五入

无穷大 Infinity  负无穷大 -Infinity  负零  -0    

被零整除在JavaScript不报错,只是返回无穷大Infinity。

零除零是没有意义的,返回  NaN (非数字值), NaN和任何数都不相等,包括自身,也就是无法使用 x == NaN来判断x变量是否是NaN,  而要使用  x!=x 来判断,当且仅当 x 为NaN的时候,表达式才为 true

var y = "one\
        long\
        line";  //一行显示的话要在每行末尾加上 \ 
var y = "one\long\line";  //如果 找不到\l这个转义字符的话,\会被忽略

var z = "0123456789";
z.charAt(0);   //第0位的字符
z.substring(2,5);   //索引第2位到第5位 截取
z.slice(2,5);  //和substring功能一样
z.slice(-3);  //截取最后三位
z.indexOf("1");  // 字符1 首次出现的位置
z.indexOf("1",3); //字符1 在 索引3位置之后 首次出现的位置
z.lastIndexOf("1"); //字符1 最后一次出现的位置

注意,字符串是固定不变的,类似replace(), toUppserCase() 都返回新字符串,原字符串本身是不变的。

if(o){
   //o不是false或任何假值(比如null或undefined)
}
if(o != null){
   //o不是 null
}

undefined 是 预定义的全局变量(和null不一样,不是关键字),它的值就是 未定义,二者都表示值得空缺

null == undefined  //true
null === undefined  //false

===  严格相等,如果两个值都是null或者都是undefined,则它们不相等

 

两个对象/数组 是永不相等的,即使含有相同的属性

类型转换

"2" * "5"  //结果是10,两个字符串均转换为10
"2" + "5"  //结果是"25", + 连接字符串
var n = 1 - "x";  //x无法转换为数字,得到的值为  NaN
n + "Object";  //NaN转为字符串 "NaN",得到的值是   "NaNObject"

"1" + 2 //结果是"12",数字转换为字符串后相加
1 + {}  //结果是  "1[object object]"
true + true  //结果是2,布尔值转换为数字后相加
2 +null //结果是2, null转换为0后相加
2 + undefined //结果是NaN, undefined转换为NaN后相加

区别:  ==  在判断前做了 类型转换, === 未转换类型

parseInt()  parseFloat()  全局函数,不属于任何类的方法

所有对象继承了2个转换方法:1,toString()   2,valueOf() 

JavaScript中对象到字符串的转换:先找 toString(),再找 valueOf(), 如果无法获得一个原始值,则抛类型转换异常

对象到数字的转换:先找valueOf()再找 toString(),否则抛异常

var d;  // 未赋值之前,值是 undefined
e;  //报错,e is not defined
var arr = [0,,,,4];  //包含5个元素,其中三个元素是 undefined
var a1 = [];  //空数组
var a2 = {};  //空对象
var o = {x:1, y:{z:3}}; //可以使用 o.y.z 或 o["y"]["z"]取值

所有无法转换为数字的操作数都会转为 NaN

new Object()
new Object   //创建对象,如果不需要传任何参数,括号可以省略

JavaScript的所有值不是真值就是假值

11 < 3 //false 数字比较
"11" < "3"  //true, 字符串比较
"11" < 3  //false, "11"转换为数字再进行数字比较
"one" < 3  //false,数字比较,"one"转换为NaN, >,<,>=,<=只要有一个为NaN,结果都为false

关于eval() : https://blog.youkuaiyun.com/u011897392/article/details/58139194

typeof null //为"object"
typeof undefined //为"undefined"
typeof true或false //为"boolean"
typeof 任意数字或NaN  // 为"number"
typeof 字符串  //为"string"
typrof 函数  //为"function"

in  

//属性
var o = {x: 1, y: 2};
"x" in o;  //true, 对象o有属性x
"toString" in o;  //true 对象继承了toString()方法

var data = [7,8,9]; 
"0" in data;  //true 如果是数组,因为是属性,data[0]为7
0 in data;  //true, 数字转换为字符串
3 in data;  //false, 没有索引为3的元素

还可以这样用哈哈 (o゚▽゚)o  

<a href="javascript:void(alert('要死要死'));">链接</a>
var o = new Object(); //创建空对象,和var o = {} 一样
var o = new Array();
var o = new RegExp("js");

var a= {a0: 0,a1: 1, a2: 2, a3: 3};
//我们知道两种写法 a.a0, a["a0"] 都可以获得值,但以下这种情况只能用a["  "]的写法
var addr;
for(var i = 0; i < 4; i++){
   addr += a["a"+i] + "\n";
}
    $(function () {
        var o = {x: 1,y: 2};   //o 从 Object.prototype 原型,继承对象的方法
        var a = inherit(o);   // a 继承 o 和 Object.prototype
        console.log(a.y);   //2
        a.x = 2;  //覆盖继承来的属性
        console.log(o.x);   //1  原来对象o的属性没受到影响
        console.log(a.x);   //2
        a.z = 3;  //属性赋值要么失败,要么创建一个属性
        console.log(a.z);   //3

       //如果查不到该属性
       console.log(o.w);  //返回undefined
       console.log(o.w.length);  //因为null或undefined是没有属性的,这里会报错
       //简练的防止报错的常用方法
       var len = o && o.w && o.w.length;
    })
    function inherit(p){
        if(p == null) throw TypeError();
        if(Object.create){
            return Object.create(p);
        }
        var t = typeof p;
        if(t !== "object" && t !== "function") throw TypeError();
        function f() {};
        f.prototype = p; //属性赋值要么失败,要么创建一个属性
        return new f();
    }


var o = {x: 1}
"x" in o;  //true
"y" in o;  //false
"toString" in o; //true o继承toString属性

//除了in之外,可以使用 !== (!== 可区分null和undefined,注意不是 !=)
o.x !== undefined    //true
o.y !== undefined    //false
o.toString !== undefined  //true o继承toString属性

o.hasOwnProperty("x");   //true
o.hasOwnProperty("y");   //false
o.hasOwnProperty("toString");  //false, 不是对象的自有属性

//跳过继承来的属性
for(p in o){
  if(!o.hasOwnProperty(p)) continue;
}

getter 和 setter

        var p = {
            $n: 1,  //$符号暗示这个属性是一个私有属性
            x: 3.0,
            y: 4.0,
            get r() { return Math.sqrt(this.x * this.x + this.y * this.y);},
            set r(newValue){
                var oldValue = Math.sqrt(this.x * this.x + this.y * this.y);
                var ratio = newValue/oldValue;
                this.x *= ratio;
                this.y *= ratio;
            }
        };
        console.log(p.r);    //5
        p.r = 50;
        console.log(p.x +","+p.y); //30,40

序列化对象 serialization是指将对象的状态转换为字符串,也可将字符串还原为对象。

          JSON.stringify() 序列化,JSON.parse() 还原JavaScript对象

数组:

var a = [];
var b = new Array();   
var c = new Array(10);  //只写一个参数的话,创建的数组长度是10,但是没有任何元素
var d = new Array(5,4,3,2,1,"test","why"); //长度是7
var e = [5,4,3,2,1,"test","why"]; //长度是7

//可以使用 负数或非整数来索引数组。这种情况下,数值将转换为“字符串”,将“字符串”作为属性名来用
a[-1.23] = true;  //创建名为"-1.23"的属性
a[1.00] //和 a[1]一样
a["1000"]  //和a[1000]一样,如果不存在,则返回 undefined
a[1000] = 1; //赋值添加一个新元素,并且设置length为1001

//JavaScript数组不存在“越界”错误

//稀疏数组
var a1 = [,,];  //长度是2,但没有元素
var a2 = [undefined,undefined];
a1[0]  //undefined
a2[0]  //undefined
0 in a1     //false,  在索引0处没有元素
0 in a2;    //true, 在索引0处有元素

a = [1,2,3,4,5] 
a.length = 0;  //删除所有的元素,a为[]
a.length = 5;  //长度为5,但没有任何元素,像new Array(5);

//可以设置length为只读
Object.defineProperty(a,"length",{writable: false});
//此时再使用 a.length = 0;就不会改变了。

//添加元素
var a = [];
a[5] = "zero";
//或者使用 push
a.push("zerp");   
a.push("zero","one");  //添加2个元素

//删除元素
var a = [1,2,3,4,5];
delete a[1];         //在索引1位置不再有元素
console.log(1 in a);  //false 索引1位置未在数组中定义
console.log(a.length);  //5 delete操作不影响数组长度

a.pop();  //删除数组的最后一个元素,长度改变
a.shift(); //删除数组的第一个元素,长度改变

//for循环
var a = [1,2,3,4,5];
for(var i = 0; i < a.length; i++){
   if(!a[i]) continue;  //跳过null,undefined,不存在的元素
   if(a[!] === undefined) continue;  //跳过undefined
   if(!(i in a)) continue; //跳过不存在的元素
}
//in 会跳过不存在的索引不会被遍历到
for(var i in a){
   if(!a.hasOwnProperty(i)) continue; //跳过继承的属性
   console.log(a[index]);
}

//forEach()方法,按照索引顺序遍历数组
a.forEach(function(value,index){
   console.log(value);  //value是值,index是索引
});

//join方法将数组所有元素转为字符串
var a = [1,2,3,4,5];
console.log(a.join());  //1,2,3,4,5  默认用逗号
console.log(a.join("")); //12345
console.log(a.join(" "));  //1 2 3 4 5

a.reverse();  //数组元素颠倒(在原数组的基础上),a变为 [5,4,3,2,1]

//sort排序
var b = ["scd","Ad","por","Fased","gerg","da"];
console.log(b.sort());   //按照字母表顺序排序,区分大小写
console.log(b.sort(function (a,b) {   //自定义排序规则,不区分大小写,负数排前面
    a = a.toLowerCase();
    b = b.toLowerCase();
    if(a < b) return -1;
    if(a > b) return 1;
    return 0;
}));

//slice截取数组,包左不包右, 不会修改原数组
var a = [0,1,2,3,4,5]; 
console.log(a.slice(0,3)); //[0,1,2]
console.log(a.slice(3));  //[3,4,5]  索引3后的内容
console.log(a.slice(0,-1)); //[0,1,2,3,4]  -1表示倒数第一个
console.log(a.slice(-3,-1)); //[3,4]  -3表示倒数第三个

//splice()会改变原数组,第一个参数指插入/删除的起始位置,第二个参数指定 删除的元素个数,
// 如果省略第二个元素,则从起始点位置后的所有元素都被删除,返回被删除的数组。
var a = [0,1,2,3,4,5,6];
console.log(a.splice(5)); //[5,6]
console.log(a); //[0,1,2,3,4]
console.log(a.splice(1,3));  //[1,2,3]
console.log(a);  //[0,4]
//从第三个参数开始,指定了要加入的元素
console.log(a.splice(1,0,1,2,3));  //[]
console.log(a);  //[0,1,2,3,4]

//every()是指所有元素都必须满足要求才返回true, some()是只要有一个元素满足要求就返回true
var a = [0,1,2,3,4,5,6]; 
console.log(a.every(function (t) { return t<10; })); //true 所有元素都小于10
console.log(a.some(function (t) { return t % 2 === 0; })); //true 至少存在一个元素能被2整除

//reduce按照 从左到右的顺序,第二个参数是初始值
var a = [1,2,3];
//初始值是0,按照从左到右顺序: 0 + 1 + 2 + 3 = 6
var sum = a.reduce(function (x, y) { return x + y; },0); 
//初始值是1,按照从左到右顺序: 1*1*2*3 = 6
var product = a.reduce(function (x, y) { return x * y; },1);
//初始值是0,按照从左到右顺序判读,结果3
var max = a.reduce(function (x, y) { return x > y ? x : y; },0);

//reduceRight() 方法与 reduce()相反,从右至左

JavaScript,函数可以嵌套在其它函数里面

当调用函数的时候传入的实参比函数声明时指定的形参个数要少,剩下的形参都将设置为undefined

arguments是指向实参对象的引用,使用下标可以访问传入函数的参数

//传入参数数量不定
function max(){
     var max = Number.NEGATIVE_INFINITY;  //负无穷大
     for(var i = 0; i < arguments.length; i++){
         if(arguments[i] > max) max = arguments[i];
     }
     return max;
}

调用 max(-34,-9,-12,-13,-48) 得到最大的 -9

第8章【函数】看的有点晕

//以下创建了10个闭包,但这些闭包都是在同一个函数调用中定义的,因此它们可以共享变量i
function constfuncs(){
   var funcs = [];
   for(var i = 0; i < 10; i++){
      funcs[i] = functio(){ return i;};
   }
   return funcs;
}

var funcs = constfuncs();
funcs[5]();   //结果是10,而不是5,这10个闭包的返回值都是10,因为共享了变量i


//需要这样写
function constfunc(i){
   return function(){return i;}
}
var funcs = [];
for(var i = 0; i < 10; i++){
  funcs[i] = constfunc(i);
}
funcs[5]();   //结果是5
function check(args){
        var actual = args.length;  //实际传参个数
        var expected = args.callee.length; //期望的传参个数
        if(actual != expected)
            throw Error("Expected " + expected + "args; got " + actual);
}

function f(x,y,z){
  check(arguments);
  return x + y + z;
}

f(1)报错 f(1,2)报错 f(1,2,3)正确返回6

 

JavaScript权威指南 犀牛书 Chapter 1. Introduction to JavaScript Section 1.1. JavaScript Myths Section 1.2. Versions of JavaScript Section 1.3. Client-Side JavaScript Section 1.4. JavaScript in Other Contexts Section 1.5. Client-Side JavaScript: Executable Content in Web Pages Section 1.6. Client-Side JavaScript Features Section 1.7. JavaScript Security Section 1.8. Example: Computing Loan Payments with JavaScript Section 1.9. Using the Rest of This Book Section 1.10. Exploring JavaScript Part I: Core JavaScript Chapter 2. Lexical Structure Section 2.1. Character Set Section 2.2. Case Sensitivity Section 2.3. Whitespace and Line Breaks Section 2.4. Optional Semicolons Section 2.5. Comments Section 2.6. Literals Section 2.7. Identifiers Section 2.8. Reserved Words Chapter 3. Data Types and Values Section 3.1. Numbers Section 3.2. Strings Section 3.3. Boolean Values Section 3.4. Functions Section 3.5. Objects Section 3.6. Arrays Section 3.7. null Section 3.8. undefined Section 3.9. The Date Object Section 3.10. Regular Expressions Section 3.11. Error Objects Section 3.12. Primitive Data Type Wrapper Objects Chapter 4. Variables Section 4.1. Variable Typing Section 4.2. Variable Declaration Section 4.3. Variable Scope Section 4.4. Primitive Types and Reference Types Section 4.5. Garbage Collection Section 4.6. Variables as Properties Section 4.7. Variable Scope Revisited Chapter 5. Expressions and Operators Section 5.1. Expressions Section 5.2. Operator Overview Section 5.3. Arithmetic Operators Section 5.4. Equality Operators Section 5.5. Relational Operators Section 5.6. String Operators Section 5.7. Logical Operators Section 5.8. Bitwise Operators Section 5.9. Assignment Operators Section 5.10. Miscellaneous Operators Chapter 6. Statements Section 6.1. Expression Statements Section 6.2. Compound Statements Section 6.3. if Section 6.4. else if Section 6.5. switch Section 6.6. while Section 6.7. do/while Section 6.8. for Section 6.9. for/in Section 6.10. Labels Section 6.11. break Section 6.12. continue Section 6.13. var Section 6.14. function Section 6.15. return Section 6.16. throw Section 6.17. try/catch/finally Section 6.18. with Section 6.19. The Empty Statement Section 6.20. Summary of JavaScript Statements Chapter 7. Functions Section 7.1. Defining and Invoking Functions Section 7.2. Functions as Data Section 7.3. Function Scope: The Call Object Section 7.4. Function Arguments: The Arguments Object Section 7.5. Function Properties and Methods Chapter 8. Objects Section 8.1. Objects and Properties Section 8.2. Constructors Section 8.3. Methods Section 8.4. Prototypes and Inheritance Section 8.5. Object-Oriented JavaScript Section 8.6. Objects as Associative Arrays Section 8.7. Object Properties and Methods Chapter 9. Arrays Section 9.1. Arrays and Array Elements Section 9.2. Array Methods Chapter 10. Pattern Matching with Regular Expressions Section 10.1. Defining Regular Expressions Section 10.2. String Methods for Pattern Matching Section 10.3. The RegExp Object Chapter 11. Further Topics in JavaScript Section 11.1. Data Type Conversion Section 11.2. By Value Versus by Reference Section 11.3. Garbage Collection Section 11.4. Lexical Scoping and Nested Functions Section 11.5. The Function( ) Constructor and Function Literals Section 11.6. Netscape's JavaScript 1.2 Incompatibilities Part II: Client-Side JavaScript Chapter 12. JavaScript in Web Browsers Section 12.1. The Web Browser Environment Section 12.2. Embedding JavaScript in HTML Section 12.3. Execution of JavaScript Programs Chapter 13. Windows and Frames Section 13.1. Window Overview Section 13.2. Simple Dialog Boxes Section 13.3. The Status Line Section 13.4. Timeouts and Intervals Section 13.5. Error Handling Section 13.6. The Navigator Object Section 13.7. The Screen Object Section 13.8. Window Control Methods Section 13.9. The Location Object Section 13.10. The History Object Section 13.11. Multiple Windows and Frames Chapter 14. The Document Object Section 14.1. Document Overview Section 14.2. Dynamically Generated Documents Section 14.3. Document Color Properties Section 14.4. Document Information Properties Section 14.5. Forms Section 14.6. Images Section 14.7. Links Section 14.8. Anchors Section 14.9. Applets Section 14.10. Embedded Data Chapter 15. Forms and Form Elements Section 15.1. The Form Object Section 15.2. Defining Form Elements Section 15.3. Scripting Form Elements Section 15.4. Form Verification Example Chapter 16. Scripting Cookies Section 16.1. An Overview of Cookies Section 16.2. Storing Cookies Section 16.3. Reading Cookies Section 16.4. Cookie Example Chapter 17. The Document Object Model Section 17.1. An Overview of the DOM Section 17.2. Using the Core DOM API Section 17.3. DOM Compatibility with Internet Explorer 4 Section 17.4. DOM Compatibility with Netscape 4 Section 17.5. Convenience Methods: The Traversal and Range APIs Chapter 18. Cascading Style Sheets and Dynamic HTML Section 18.1. Styles and Style Sheets with CSS Section 18.2. Element Positioning with CSS Section 18.3. Scripting Styles Section 18.4. DHTML in Fourth-Generation Browsers Section 18.5. Other DOM APIs for Styles and Style Sheets Chapter 19. Events and Event Handling Section 19.1. Basic Event Handling Section 19.2. Advanced Event Handling with DOM Level 2 Section 19.3. The Internet Explorer Event Model Section 19.4. The Netscape 4 Event Model Chapter 20. Compatibility Techniques Section 20.1. Platform and Browser Compatibility Section 20.2. Language Version Compatibility Section 20.3. Compatibility with Non-JavaScript Browsers Chapter 21. JavaScript Security Section 21.1. JavaScript and Security Section 21.2. Restricted Features Section 21.3. The Same-Origin Policy Section 21.4. Security Zones and Signed Scripts Chapter 22. Using Java with JavaScript Section 22.1. Scripting Java Applets Section 22.2. Using JavaScript from Java Section 22.3. Using Java Classes Directly Section 22.4. LiveConnect Data Types Section 22.5. LiveConnect Data Conversion Section 22.6. JavaScript Conversion of JavaObjects Section 22.7. Java-to-JavaScript Data Conversion Part III: Core JavaScript Reference Chapter 23. Core JavaScript Reference Sample Entry arguments[ ] Arguments Arguments.callee Arguments.length Array Array.concat( ) Array.join( ) Array.length Array.pop( ) Array.push( ) Array.reverse( ) Array.shift( ) Array.slice( ) Array.sort( ) Array.splice( ) Array.toLocaleString( ) Array.toString( ) Array.unshift( ) Boolean Boolean.toString( ) Boolean.valueOf( ) Date Date.getDate( ) Date.getDay( ) Date.getFullYear( ) Date.getHours( ) Date.getMilliseconds( ) Date.getMinutes( ) Date.getMonth( ) Date.getSeconds( ) Date.getTime( ) Date.getTimezoneOffset( ) Date.getUTCDate( ) Date.getUTCDay( ) Date.getUTCFullYear( ) Date.getUTCHours( ) Date.getUTCMilliseconds( ) Date.getUTCMinutes( ) Date.getUTCMonth( ) Date.getUTCSeconds( ) Date.getYear( ) Date.parse( ) Date.setDate( ) Date.setFullYear( ) Date.setHours( ) Date.setMilliseconds( ) Date.setMinutes( ) Date.setMonth( ) Date.setSeconds( ) Date.setTime( ) Date.setUTCDate( ) Date.setUTCFullYear( ) Date.setUTCHours( ) Date.setUTCMilliseconds( ) Date.setUTCMinutes( ) Date.setUTCMonth( ) Date.setUTCSeconds( ) Date.setYear( ) Date.toDateString( ) Date.toGMTString( ) Date.toLocaleDateString( ) Date.toLocaleString( ) Date.toLocaleTimeString( ) Date.toString( ) Date.toTimeString( ) Date.toUTCString( ) Date.UTC( ) Date.valueOf( ) decodeURI( ) decodeURIComponent( ) encodeURI( ) encodeURIComponent( ) Error Error.message Error.name Error.toString( ) escape( ) eval( ) EvalError Function Function.apply( ) Function.arguments[] Function.call( ) Function.caller Function.length Function.prototype Function.toString( ) Global Infinity isFinite( ) isNaN( ) Math Math.abs( ) Math.acos( ) Math.asin( ) Math.atan( ) Math.atan2( ) Math.ceil( ) Math.cos( ) Math.E Math.exp( ) Math.floor( ) Math.LN10 Math.LN2 Math.log( ) Math.LOG10E Math.LOG2E Math.max( ) Math.min( ) Math.PI Math.pow( ) Math.random( ) Math.round( ) Math.sin( ) Math.sqrt( ) Math.SQRT1_2 Math.SQRT2 Math.tan( ) NaN Number Number.MAX_VALUE Number.MIN_VALUE Number.NaN Number.NEGATIVE_INFINITY Number.POSITIVE_INFINITY Number.toExponential( ) Number.toFixed( ) Number.toLocaleString( ) Number.toPrecision( ) Number.toString( ) Number.valueOf( ) Object Object.constructor Object.hasOwnProperty( ) Object.isPrototypeOf( ) Object.propertyIsEnumerable( ) Object.toLocaleString( ) Object.toString( ) Object.valueOf( ) parseFloat( ) parseInt( ) RangeError ReferenceError RegExp RegExp.exec( ) RegExp.global RegExp.ignoreCase RegExp.lastIndex RegExp.source RegExp.test( ) RegExp.toString( ) String String.charAt( ) String.charCodeAt( ) String.concat( ) String.fromCharCode( ) String.indexOf( ) String.lastIndexOf( ) String.length String.localeCompare( ) String.match( ) String.replace( ) String.search( ) String.slice( ) String.split( ) String.substr( ) String.substring( ) String.toLocaleLowerCase( ) String.toLocaleUpperCase( ) String.toLowerCase( ) String.toString( ) String.toUpperCase( ) String.valueOf( ) SyntaxError TypeError undefined unescape( ) URIError Part IV: Client-Side JavaScript Reference Chapter 24. Client-Side JavaScript Reference Sample Entry Anchor Applet Area Button Button.onclick Checkbox Checkbox.onclick Document Document.all[] Document.captureEvents( ) Document.clear( ) Document.close( ) Document.cookie Document.domain Document.elementFromPoint( ) Document.getSelection( ) Document.handleEvent( ) Document.lastModified Document.links[] Document.open( ) Document.releaseEvents( ) Document.routeEvent( ) Document.URL Document.write( ) Document.writeln( ) Element Event FileUpload FileUpload.onchange Form Form.elements[] Form.onreset Form.onsubmit Form.reset( ) Form.submit( ) Form.target Frame getClass( ) Hidden History History.back( ) History.forward( ) History.go( ) HTMLElement HTMLElement.contains( ) HTMLElement.getAttribute( ) HTMLElement.handleEvent( ) HTMLElement.insertAdjacentHTML( ) HTMLElement.insertAdjacentText( ) HTMLElement.onclick HTMLElement.ondblclick HTMLElement.onhelp HTMLElement.onkeydown HTMLElement.onkeypress HTMLElement.onkeyup HTMLElement.onmousedown HTMLElement.onmousemove HTMLElement.onmouseout HTMLElement.onmouseover HTMLElement.onmouseup HTMLElement.removeAttribute( ) HTMLElement.scrollIntoView( ) HTMLElement.setAttribute( ) Image Image.onabort Image.onerror Image.onload Input Input.blur( ) Input.click( ) Input.focus( ) Input.name Input.onblur Input.onchange Input.onclick Input.onfocus Input.select( ) Input.type Input.value JavaArray JavaClass JavaObject JavaPackage JSObject JSObject.call( ) JSObject.eval( ) JSObject.getMember( ) JSObject.getSlot( ) JSObject.getWindow( ) JSObject.removeMember( ) JSObject.setMember( ) JSObject.setSlot( ) JSObject.toString( ) Layer Layer.captureEvents( ) Layer.handleEvent( ) Layer.load( ) Layer.moveAbove( ) Layer.moveBelow( ) Layer.moveBy( ) Layer.moveTo( ) Layer.moveToAbsolute( ) Layer.offset( ) Layer.releaseEvents( ) Layer.resizeBy( ) Layer.resizeTo( ) Layer.routeEvent( ) Link Link.onclick Link.onmouseout Link.onmouseover Link.target Location Location.reload( ) Location.replace( ) MimeType Navigator Navigator.javaEnabled( ) Navigator.plugins.refresh( ) Option Password Plugin Radio Radio.onclick Reset Reset.onclick Screen Select Select.onchange Select.options[] Style Submit Submit.onclick Text Text.onchange Textarea Textarea.onchange URL Window Window.alert( ) Window.back( ) Window.blur( ) Window.captureEvents( ) Window.clearInterval( ) Window.clearTimeout( ) Window.close( ) Window.confirm( ) Window.defaultStatus Window.focus( ) Window.forward( ) Window.handleEvent( ) Window.home( ) Window.moveBy( ) Window.moveTo( ) Window.name Window.navigate( ) Window.onblur Window.onerror Window.onfocus Window.onload Window.onmove Window.onresize Window.onunload Window.open( ) Window.print( ) Window.prompt( ) Window.releaseEvents( ) Window.resizeBy( ) Window.resizeTo( ) Window.routeEvent( ) Window.scroll( ) Window.scrollBy( ) Window.scrollTo( ) Window.setInterval( ) Window.setTimeout( ) Window.status Window.stop( ) Part V: W3C DOM Reference Chapter 25. W3C DOM Reference Sample Entry AbstractView AbstractView.getComputedStyle( ) Attr CDATASection CharacterData CharacterData.appendData( ) CharacterData.deleteData( ) CharacterData.insertData( ) CharacterData.replaceData( ) CharacterData.substringData( ) Comment Counter CSS2Properties CSSCharsetRule CSSFontFaceRule CSSImportRule CSSMediaRule CSSMediaRule.deleteRule( ) CSSMediaRule.insertRule( ) CSSPageRule CSSPrimitiveValue CSSPrimitiveValue.getCounterValue( ) CSSPrimitiveValue.getFloatValue( ) CSSPrimitiveValue.getRectValue( ) CSSPrimitiveValue.getRGBColorValue( ) CSSPrimitiveValue.getStringValue( ) CSSPrimitiveValue.setFloatValue( ) CSSPrimitiveValue.setStringValue( ) CSSRule CSSRuleList CSSRuleList.item( ) CSSStyleDeclaration CSSStyleDeclaration.getPropertyCSSValue( ) CSSStyleDeclaration.getPropertyPriority( ) CSSStyleDeclaration.getPropertyValue( ) CSSStyleDeclaration.item( ) CSSStyleDeclaration.removeProperty( ) CSSStyleDeclaration.setProperty( ) CSSStyleRule CSSStyleSheet CSSStyleSheet.deleteRule( ) CSSStyleSheet.insertRule( ) CSSUnknownRule CSSValue CSSValueList CSSValueList.item( ) Document Document.createAttribute( ) Document.createAttributeNS( ) Document.createCDATASection( ) Document.createComment( ) Document.createDocumentFragment( ) Document.createElement( ) Document.createElementNS( ) Document.createEntityReference( ) Document.createEvent( ) Document.createNodeIterator( ) Document.createProcessingInstruction( ) Document.createRange( ) Document.createTextNode( ) Document.createTreeWalker( ) Document.getElementById( ) Document.getElementsByTagName( ) Document.getElementsByTagNameNS( ) Document.getOverrideStyle( ) Document.importNode( ) DocumentCSS DocumentEvent DocumentFragment DocumentRange DocumentStyle DocumentTraversal DocumentType DocumentView DOMException DOMImplementation DOMImplementation.createCSSStyleSheet( ) DOMImplementation.createDocument( ) DOMImplementation.createDocumentType( ) DOMImplementation.createHTMLDocument( ) DOMImplementation.hasFeature( ) DOMImplementationCSS Element Element.getAttribute( ) Element.getAttributeNode( ) Element.getAttributeNodeNS( ) Element.getAttributeNS( ) Element.getElementsByTagName( ) Element.getElementsByTagNameNS( ) Element.hasAttribute( ) Element.hasAttributeNS( ) Element.removeAttribute( ) Element.removeAttributeNode( ) Element.removeAttributeNS( ) Element.setAttribute( ) Element.setAttributeNode( ) Element.setAttributeNodeNS( ) Element.setAttributeNS( ) ElementCSSInlineStyle Entity EntityReference Event Event.initEvent( ) Event.preventDefault( ) Event.stopPropagation( ) EventException EventListener EventTarget EventTarget.addEventListener( ) EventTarget.dispatchEvent( ) EventTarget.removeEventListener( ) HTMLAnchorElement HTMLAnchorElement.blur( ) HTMLAnchorElement.focus( ) HTMLBodyElement HTMLCollection HTMLCollection.item( ) HTMLCollection.namedItem( ) HTMLDocument HTMLDocument.close( ) HTMLDocument.getElementById( ) HTMLDocument.getElementsByName( ) HTMLDocument.open( ) HTMLDocument.write( ) HTMLDocument.writeln( ) HTMLDOMImplementation HTMLElement HTMLFormElement HTMLFormElement.reset( ) HTMLFormElement.submit( ) HTMLInputElement HTMLInputElement.blur( ) HTMLInputElement.click( ) HTMLInputElement.focus( ) HTMLInputElement.select( ) HTMLOptionElement HTMLSelectElement HTMLSelectElement.add( ) HTMLSelectElement.blur( ) HTMLSelectElement.focus( ) HTMLSelectElement.remove( ) HTMLTableCaptionElement HTMLTableCellElement HTMLTableColElement HTMLTableElement HTMLTableElement.createCaption( ) HTMLTableElement.createTFoot( ) HTMLTableElement.createTHead( ) HTMLTableElement.deleteCaption( ) HTMLTableElement.deleteRow( ) HTMLTableElement.deleteTFoot( ) HTMLTableElement.deleteTHead( ) HTMLTableElement.insertRow( ) HTMLTableRowElement HTMLTableRowElement.deleteCell( ) HTMLTableRowElement.insertCell( ) HTMLTableSectionElement HTMLTableSectionElement.deleteRow( ) HTMLTableSectionElement.insertRow( ) HTMLTextAreaElement HTMLTextAreaElement.blur( ) HTMLTextAreaElement.focus( ) HTMLTextAreaElement.select( ) LinkStyle MediaList MediaList.appendMedium( ) MediaList.deleteMedium( ) MediaList.item( ) MouseEvent MouseEvent.initMouseEvent( ) MutationEvent MutationEvent.initMutationEvent( ) NamedNodeMap NamedNodeMap.getNamedItem( ) NamedNodeMap.getNamedItemNS( ) NamedNodeMap.item( ) NamedNodeMap.removeNamedItem( ) NamedNodeMap.removeNamedItemNS( ) NamedNodeMap.setNamedItem( ) NamedNodeMap.setNamedItemNS( ) Node Node.appendChild( ) Node.cloneNode( ) Node.hasAttributes( ) Node.hasChildNodes( ) Node.insertBefore( ) Node.isSupported( ) Node.normalize( ) Node.removeChild( ) Node.replaceChild( ) NodeFilter NodeIterator NodeIterator.detach( ) NodeIterator.nextNode( ) NodeIterator.previousNode( ) NodeList NodeList.item( ) Notation ProcessingInstruction Range Range.cloneContents( ) Range.cloneRange( ) Range.collapse( ) Range.compareBoundaryPoints( ) Range.deleteContents( ) Range.detach( ) Range.extractContents( ) Range.insertNode( ) Range.selectNode( ) Range.selectNodeContents( ) Range.setEnd( ) Range.setEndAfter( ) Range.setEndBefore( ) Range.setStart( ) Range.setStartAfter( ) Range.setStartBefore( ) Range.surroundContents( ) Range.toString( ) RangeException Rect RGBColor StyleSheet StyleSheetList StyleSheetList.item( ) Text Text.splitText( ) TreeWalker TreeWalker.firstChild( ) TreeWalker.lastChild( ) TreeWalker.nextNode( ) TreeWalker.nextSibling( ) TreeWalker.parentNode( ) TreeWalker.previousNode( ) TreeWalker.previousSibling( ) UIEvent UIEvent.initUIEvent( ) ViewCSS Part VI: Class, Property, Method, and Event Handler Index Chapter 26. Class, Property, Method, and Event Handler Index Section 26.1. A Section 26.2. B Section 26.3. C Section 26.4. D Section 26.5. E Section 26.6. F Section 26.7. G Section 26.8. H Section 26.9. I Section 26.10. J Section 26.11. K Section 26.12. L Section 26.13. M Section 26.14. N Section 26.15. O Section 26.16. P Section 26.17. Q Section 26.18. R Section 26.19. S Section 26.20. T Section 26.21. U Section 26.22. V Section 26.23. W Section 26.24. X Section 26.25. Y Section 26.26. Z
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值