개체가 myObject
이고 내부에 execute()
의 기능이 있고 $.ajax({
에는 complete: function(xmlHttp){
이 있습니다. 이 함수 내에서 myObject
에 정의 된 setResult를 호출하려고합니다. 그렇게하는 방법?jQuery를 사용한 JavaScript OOP
function myObject() {
this.setResult = setResult;
function setResult(result) {
this.result = result;
}
function execute() {
$.ajax({
complete: function(xmlHttp){
(?) setResult(jQuery.parseJSON(xmlHttp.responseText));
}
});
}