這個JavaScript成語的基礎(chǔ)是什么:var Self=this?我在源代碼中看到了WebKit HTML 5 SQL存儲Notes演示:function Note() {
var self = this;
var note = document.createElement('div');
note.className = 'note';
note.addEventListener('mousedown', function(e) { return self.onMouseDown(e) }, false);
note.addEventListener('click', function() { return self.onNoteClick() }, false);
this.note = note;
// ...}作者使用自性在某些地方(功能體)和這,這個在其他地方(方法的參數(shù)列表中定義的函數(shù)體)。到底怎么回事?現(xiàn)在我已經(jīng)注意到它一次,我會開始看到它無處不在嗎?
這個JavaScript成語的基礎(chǔ)是什么:var Self=this?
慕的地6264312
2019-06-21 17:00:00