function Person() { this.init() } Person.prototype = { constructor: Person, init: function() { document.documentElement.addEventListener(‘click‘, this, false) }, handleEvent: function(event) { this.say() }, say: function() { alert(‘hello world!‘) } } var person = new Person()
原文:http://www.cnblogs.com/jzm17173/p/3951252.html