我有两个单独的 Ajax Post 请求,我需要将它们加在一起,它们都链接到货币兑换提要,它基本上是从不同货币转换而来的两个值,然后在都转换为一种货币后需要加在一起,我让它们都使用相同的货币不,我只需将两个结果相加即可得到最终总数。
这是两个请求
var dataString = "amount=" + entireTotal + "&from=" + from + "&to=" + to;
//Lets Get the exchange rates from our total
$.ajax({
type: "POST",
url: "http://fileserver/website/modules/mod_calculation/js/currency.php",
data: dataString,
success: function(data){
$('#inputresult').show();
//Put received response into result div
$('#inputresult').html(data);
}
});
var dataString = "amount=" + amountGel + "&from=" + fromGel + "&to=" + toGel;
$.ajax({
type: "POST",
url: "http://fileserver/website/modules/mod_calculation/js/currencygel.php",
data: dataString,
success: function(data){
$('#resultsgel').html(data);
//Show results div
$('#resultsgel').show();
//Put received response into result div
}
});
任何帮助都会非常感激..谢谢:)