一, 理解Javascript的运行环境概念
function say(msg) { alert(this + ' says ' + msg); } var tt = { message: 'James ', say: function (thing) { alert(this.message + thing); } } var ss = { message: 'Alex ', say: function (thing) { alert(this.message + ' solve ' + thing); } } tt.say.call(ss, "Hello World");
// output: Alex Hello World
二 JS的模块化编程规范
RequireJS http://requirejs.org/
Javascript AMD规范
sizzlejs CSS选择器