My script loads an iframe when the user clicks a button. I want to call another function after the iframe loads, but it\'s not working. The iframe does load normally, but
Seems somewhat similiar to the question here:
jQuery .ready in a dynamically inserted iframe
This way the Iframe element exists in the Dom with the append. Only when you set the Url will it load, by which point you've attached the load function you wish to tag on the end. So for your code
$('#someButton').live('click', function () {
$('body').append($(''));
$('#myIframe').attr('src',"https://www.mywebsite.com");
$('#myIframe').load(function () {
alert('iframe loaded');
});
});