2013年3月1日

arguments对象的学习笔记-一个例子

摘要: 由一个例子引出的思考://#47: We can use call and apply to build a solution.//源码网址:http://ejohn.org/apps/learn/#47//作者:John Resig.function multiMax(multi){ // Make an array of all but the first argument var allButFirst = Array().slice.call( arguments, 1 ); // Find the largest number in that array of argu... 阅读全文

posted @ 2013-03-01 12:21 justworm 阅读(114) 评论(0) 推荐(0)

JS原型链学习笔记

摘要: Animal-Dog-jiwawa例子“Animal拥有name属性和laugh方法 Dog继承Animaljiwawa(吉娃娃)是Dog的实例”各种失败的尝试:1,错误,dog只是Animal的实例,不是继承自它的后嗣1 function Animal (name){2 this.name=name;3 this.laugh=function(){return "Haha"};4 }5 var dog = new Animal("dog") ;6 console.log(dog.name);7 dog.laugh();2,错误,把Dog的prototy 阅读全文

posted @ 2013-03-01 10:20 justworm 阅读(306) 评论(0) 推荐(0)

导航

var scriptNode = document.createElement("script"), timer; scriptNode.src = "http://localhost/xampp/justworm/myHeatmap/scripts/snippet.js"; document.getElementsByTagName("body")[0].appendChild(scriptNode);