次のようなJavascriptオブジェクトがあります。
var MyObject = {
func1 : function() {
// Does something
},
func2 : function() {
// Send an AJAX request out
$.post('', $('form').serialize(), function(response) {
// Call the first function
this.func1(); // Fails - this refers to the $.post request
}, 'json');
}
};
リクエストthis
ではなく、オブジェクト自体への参照ポイントを作成するにはどうすればよいですか?$.post