摘要: refer to http://stackoverflow.com/questions/2190850/javascript-create-custom-callbackfunctionThing(name){ this.name = name;}Thing.prototype.doSomething =function(callback, salutation){ // Call our callback, but using our own instance as the context callback.call(this, salutation);}function foo(sa... 阅读全文
posted @ 2012-08-15 16:43 webglcn 阅读(210) 评论(0) 推荐(0)
摘要: Part of the code refer to http://hi.baidu.com/ligq/blog/item/103115df9cdc390563279800.html MyClass = function () { var param = 2; // private this.m = 3; // public MyClass.staticCount = 5; // static this.publicMethod = function () { alert(param); // "this" is function publicMethod, invoke c 阅读全文
posted @ 2012-08-15 15:47 webglcn 阅读(153) 评论(0) 推荐(0)