Code
//在线客服
function olService() {
this.code = "";
$.ajax({
url: "/service/businessContact",
data: {},
type: "GET",
success: function(text) { this.code = text; },
error: function(text) { }
});
}
olService.prototype.show = function() {
document.body.innerHTML += this.code;
}
异步调用获取不为空但是show()方法中却是空,等 show()方法执行完了才将值付给了this.code,
怎么解决啊??