I have two jQuery Ajax calls that I combine on a page. I am stuck on success: function()in each, as one success: function(msg)and the other success: function(data). I'm not sure what they both mean, and that they should be in combined code. I put the two calls below separately and combined them until I still have them.
Ajax Request # 1: there are php functions on this page $msg .= "<div class='pagination'><ul>";. Not sure what this is about.
$.ajax
({
type: "GET",
url: "new_arrivals_data.php",
data: "page="+page,
success: function(msg)
{
$("#gallery_container").ajaxComplete(function(event, request, settings)
{
gallery_show();
loading_hide();
$("#gallery_container").html(msg);
});
}
});
Ajax Request # 2: As far as I see, there is no call in this php file data. I donβt know what it refers to function(data).
$.get("new_arrivals_data.php",{imgs: value}, function(data){
$("#gallery_container").html(data);
});
Combined query: I put ?where I msgwas in the original call, since I'm not sure what to put in it.
$.ajax
({
type: "GET",
url: "new_arrivals_data.php",
data: {page:page, imgs: value},
success: function(?)
{
$("#gallery_container").ajaxComplete(function(event, request, settings)
{
gallery_show();
loading_hide();
$("#gallery_container").html(?);
});
}
});