check if iframe src is valid code example
Example: jquery check if iframe is loaded
$('#myIframe').on('load', function(){
//your code (will be called once iframe is done loading)
});
$('#myIframe').on('load', function(){
//your code (will be called once iframe is done loading)
});