I have two Ajax requests that I am wanting to combine together into one. I’m having trouble figuring how to do this as one is using $.ajax() and another is using $.get().
As I’m fairly new to Ajax, this is causing me much pain. If you could help, it would me much appreciated.
Ajax Request #1
$.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
$.get("new_arrivals_data.php",{imgs: value}, function(data){
$("#gallery_container").html(data);
});
Thanks for any help you can offer.
They are actually both GETs
$.getis short hand for$.ajax({ type:'GET'.So combining them might work depending on your server’s response: