第161页 SINGLETON BUILT-IN OBJECTS
byhard (byhard.com)
- 章节名:SINGLETON BUILT-IN OBJECTS
- 页码:第161页
The Global Object URI-Encoding Methods encodeURI() & encodeURIComponent() 比如: var uri = “http://www.wrox.com/illegal value.htm#start”; //”http://www.wrox.com/illegal%20value.htm#start” alert(encodeURI(uri)); //”http%3A%2F%2Fhttp://www.wrox.com%2Fillegal%20value.htm%23start” alert(encodeURIComponent(uri)); 反运算: decodeURI() & decodeURIComponent() 比如: var uri = “http%3A%2F%2Fhttp://www.wrox.com%2Fillegal%20value.htm%23start”; //http%3A%2F%2Fhttp://www.wrox.com%2Fillegal value.htm%23start alert(decodeURI(uri)); //http://www.wrox.com/illegal value.htm#start alert(decodeURIComponent(uri)); eval()方法:相当于js的解释器与执行器。 eval(“alert(‘hi’)”); //相当于:alert("hi"); var msg = “hello world”; eval(“alert(msg)”); //”hello world” eval(“function sayHi() { alert(‘hi’); }”); sayHi(); eval(“var msg = ‘hello world’;”); alert(msg); //”hello world” Global Object Properties PROPERTY DESCRIPTION undefined The special value undefined NaN The special value NaN Infinity The special value Infinity Object Constructor for Object Array Constructor for Array Function Constructor for Function Boolean Constructor for Boolean String Constructor for String Number Constructor for Number Date Constructor for Date RegExp Constructor for RegExp Error Constructor for Error EvalError Constructor for EvalError RangeError Constructor for RangeError ReferenceError Constructor for ReferenceError SyntaxError Constructor for SyntaxError TypeError Constructor for TypeError URIError Constructor for URIError The Window Object
byhard对本书的所有笔记 · · · · · ·
-
第141页 THE FUNCTION TYPE
Function Internals Two special objects exist inside a function: arguments and this. the...
-
第146页 PRIMITIVE WRAPPER TYPES
原类型对应的引用类型:Boolean, Number, String. Three special reference types are design...
-
第161页 SINGLETON BUILT-IN OBJECTS
-
第165页 SINGLETON BUILT-IN OBJECTS
The Math Object The min() and max() Methods var max = Math.max(3, 54, 32, 16); alert(ma...
-
第173页 UNDERSTANDING OBJECTS
ECMAScript objects as hash tables: nothing more than a grouping of name-value pairs whe...
说明 · · · · · ·
表示其中内容是对原文的摘抄