首页 新闻 赞助 找找看

怎样让异步js先于方法执行???

0
[已关闭问题]
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,

 怎么解决啊??

New.min的主页 New.min | 菜鸟二级 | 园豆:313
提问于:2009-09-18 12:03
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册