87,910
社区成员
发帖
与我相关
我的任务
分享
function myfun(o) {
o.result('我是返回值');
}
myfun({
arg1: '1',
arg2: '2',
result: function(msg) {
alert(msg);
}
});
function ajax(o) {
var req = createXHR();
req.onreadystatechange = function() {
if(..success..) {
o.success(req.responseText);
}
}
req.open('GET', o.url, true);
req.send(NULL);
}
ajax({
type: 'get',
success: function(msg) {
alert(msg);
}
});