一, 理解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選擇器