function vote_helper(content_id, thevote){
var result = "";
$.ajax({
type:"POST",
url:"/vote",
data:{'thevote':thevote, 'content_id':content_id},
beforeSend:function() {
},
success:function(html){
result = html;
}
});
return result;
};
我想返回结果。但它返回空白字符串。如何返回JQuery中的某些内容?
返回?从函数vote_helper?你不能,POST还没有完成。 – Malvolio 2011-01-11 00:46:28
哦,亲爱的,另一个“我如何从异步功能返回”的问题。 – 2011-01-11 00:48:16