上一页 1 2 3 4 5 6 ··· 9 下一页
摘要: var test = function() {//将其看成是创建了一个对象 alert(1); } var otherTest = test;//赋值导致test和otherTest指向同一个对象 otherTest(); test.sd = 9;//对对象进行操作,两者都发生改变 alert(otherTest.sd);//9 ... 阅读全文
posted @ 2016-04-18 19:49 绯乐 阅读(117) 评论(0) 推荐(0) 编辑
摘要: /* var person = {}; person.getName = function() { alert("name1"); } var employee = {}; employee.getTitle = function() { alert("title1"); } //从person对象中... 阅读全文
posted @ 2016-04-17 20:13 绯乐 阅读(244) 评论(0) 推荐(0) 编辑
摘要: JS是一种原型式(prototype-style)的OO(Object Oriented——面向对象)语言,没有类的概念,所有一切都派生自现有对象的一个副本。在JavaScript中,从函数到字符串实际上都是对象,而这也正是JavaScript既强大又令人费解的根源所在。而Math、Date、Reg 阅读全文
posted @ 2016-04-17 20:12 绯乐 阅读(683) 评论(0) 推荐(0) 编辑
摘要: var fauxConstant = "123"; function badFunction() { fauxConstant = "456"; } function goodFunction() { var fauxConstant = "456"; } function testIt() { ... 阅读全文
posted @ 2016-04-17 19:41 绯乐 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-04-17 13:06 绯乐 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Jason(JavaScript Object Notation,JavaScript对象表示法) 阅读全文
posted @ 2016-04-17 11:12 绯乐 阅读(529) 评论(0) 推荐(0) 编辑
摘要: 原型(prototype):所有的JS对象都可以通过其原型来扩展,并且这个功能允许创建自定义类。 阅读全文
posted @ 2016-04-17 10:35 绯乐 阅读(122) 评论(0) 推荐(0) 编辑
摘要: function test() { var i = 1; if (1) { var i = 2; if (1) { var i = 3; alert(i);//3 } alert(i);//3 ... 阅读全文
posted @ 2016-04-17 09:10 绯乐 阅读(113) 评论(0) 推荐(0) 编辑
摘要: function Person1(firstName, lastName) {//无法推断参数的含义 this.firstName = firstName; this.lastName = lastName; this.toString = function() { return this.firstName + "... 阅读全文
posted @ 2016-04-17 09:03 绯乐 阅读(221) 评论(0) 推荐(0) 编辑
摘要: var startTime = new Date().valueOf(); var s = ""; for (var i = 0; i "); document.write(goodTest()+""); document.write(betterTest()+""); 阅读全文
posted @ 2016-04-17 08:54 绯乐 阅读(197) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 9 下一页