2017-01-02 86 views
1

这里是我当前的代码:在AJAX成功回调中调用另一个PHP脚本?

$.ajax({ 
    type: "POST" 
    , url: "first-script.php" 
    , data: { 
     dataPoint: dataValue 
    } 
    , success: function (dataPath) { 
     // Do stuff with dataPath 

     // Call another PHP script once done. 
    } 
}); 

我停留在Call another PHP script once done.一部分。我怎样才能做到这一点?它有可能吗?有其他方法吗?

+1

另一个Ajax请求? –

+1

只需添加另一个Ajax请求即可 –

+0

@RossWilson我是否需要嵌套请求? –

回答

0

巢与以前的Ajax请求的成功回调了ajax:

$.ajax({ 
type: "POST", 
url: "first-script.php", 
data: { 
     dataPoint: dataValue 
    }, 
success: function (dataPath) { 
    //Another request 
    $.ajax({}); 
});