Execute a function when both ajax requests are complete. From http://api.jquery.com/jQuery.when/
$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done( function( a1, a2 ) { // do something });