Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

Js 的回调方法怎么写啊

$
0
0

@jumpchess1 写道:

AAA.js

let bbb = new BBB();
bbb.setCallback(this.response);
...
response: function(message) {
    cc.log(message);
},

BBB.js

properties: {
    response : null,
},

setCallback: function (re){
    this.response = re;
}

...
this.response(message);

最后报错 Connect.js:63 Uncaught TypeError: this.response is not a function
at XMLHttpRequest.xhr.onreadystatechange

帖子: 6

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>