Is it possible to call two urls through a button in jQuery. For example, I want to add the commented one as well. How shall I represent them?
$.ajax({
You can't make an AJAX request to 2 URLs simultaneously/in the same call, you'll need to call them separately as 2 different $.ajax() calls.
You could make it a function for example:
function doAJAX(url) {
$.ajax({
url: url,
type: 'POST',
async: false,
data: {"fId":"abc"},
dataType: 'xml',
error: function(){
alert('Error loading XML document');
},
success: function(data){
//check error
alert("success");
var $error=$(data).find('error').text();
if($error!="0")
{
messageBox("Error",$error);
}
}
});
}
doAJAX('ajax/releaseBackEnd.php');
doAJAX('batch/2-release-tmp.php');