Reputation: 5461
I tried to implement the following function
$(document).ready(function() {
$("#viewresult input:button").click(function () {
var selectedset = document.getElementById("selectedset").value;
$.get("EditSet.php", "selectedset="+selectedset+"", function(){
});
var str = $("#selectform").serialize();
$.ajax({
type: "POST",
url: "editsetsphoto.php",
data: str,
cache: false,
success: function(msg)
{
$("#thumbnails").ajaxComplete(function(){
$(this).fadeIn("slow").html(msg)
});
}
});
return false;
});
});
Is it possible to get it work when I call two ajax function send to two different php files in one click?
Upvotes: 0
Views: 984
Reputation: 25776
Sure, since your ajax requests are independent, you don't need to utilize the callback on the get request.
$(function(){
$("#viewresult input:button").click(function () {
var selectedset = $("#selectedset").val();
$.get("EditSet.php", "selectedset="+ selectedset );
var str = $("#selectform").serialize();
$.ajax({
type: "POST",
url: "editsetsphoto.php",
data: str,
cache: false,
success: function(msg)
{
$("#thumbnails").html(msg).fadeIn('slow');
}
});
});
});
Upvotes: 1