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!")