the src property just sets the url for the frame, but the load function is supported by the jquery engine.so global ajax functions wait for the load () function to complete
$("#iframe").attr('src',"someurl");
First make sure the ajax event is asynchronous and use this,
$('#iframe').load('someurl');
this is the only way to display a βWaitβ message or gif loader until a new URL is loaded.
source share