JavaScriptでcallback処理で呼元のthisを参照したい時がよくあります。 例えば、下のような感じです。 var Hoge = function(name){ this.name = name; }; Hoge.prototype.method = function(){ var url = ''; var param = {}; $.post(url, param, function(data){ alert(this.name); }); }; var hoge = new Hoge('aaa'); hoge.method(); で、thisの中身はHogeではないので、postのundefinedがalertに表示されます。 これを解決するには、以下のようにbindメソッドを使うとOKです。 Hoge.prototype.method = function(){ var

