Created
June 19, 2012 08:23
-
-
Save tamtam180/2953002 to your computer and use it in GitHub Desktop.
どーすりゃよいのでござるか・・
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Hoge() { | |
} | |
Hoge.ptototype = { | |
kwd : [], | |
doFuga : function() { | |
var jqxhr = this.fetchKwd(); // 何かしらのajax | |
jqxhr.success(function(){ | |
// ここで kwdにアクセスしたい... | |
}); | |
} | |
}; | |
// thisだとjqueryのものが返ってくる.. | |
// Javaで言うところのHoge.thisみたいな | |
/* | |
こうやるしかない? | |
var mthis = this; | |
jqxhr.success(function(){ | |
// ここで kwdにアクセスしたい... | |
alert(mthis.kwd); | |
}); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment