0
假设我用ajax调用触发多个Python函数。有没有办法接收多个响应(以表明它们都已成功?)。一个抽象的例子:每个函数有多个ajax响应?
function triggerPython(){
$.ajax({
url:"/triggerPython",
type:'POST',
data: whatever,
success: function(response){
alert(response);
}
});
}
蛇皮:
class triggerPython(webapp.RequestHandler):
def post(self):
function_1()
self.response.out("Function 1 done!")
function_2()
self.response.out("Function 2 done!")
function_3()
self.response.out("Function 3 done!")