I have a button that loads two different pages in two iframes. I need to wait for those loads to complete (like ready(), don\'t care about images and other content) and the
Using $.when() will help you (jQuery 1.5 and higher). For example:
function doAjax(){
return $.get('foo.htm');
}
function doMoreAjax(){
return $.get('bar.htm');
}
$.when( doAjax(), doMoreAjax() )
.then(function(){
console.log( 'I fire once BOTH ajax requests have completed!' );
})
.fail(function(){
console.log( 'I fire if one or more requests failed.' );
});