I am loading an arbitrary page into an element. However, I want to call a method only AFTER I'm sure that page has loaded. Is there a way to detect such an event?
<body>
<div id="testFrame" style="width: 640px; height: 480px; border: solid; border-width: thick;"></div>
<input id="reload" type="button" value="Refresh"/>
<script>
$(document).ready(function(){
$('#reload').click(function(e){
e.preventDefault();
$("#testFrame").html('<object id="idObject" width="640" height="480"data="http://www.microsoft.com">');
});
$( "#idObject" ).isLoaded(function() { // Not a real function
alert("frame loaded"); // Show a message when the page is loaded
});
});
</script>
</body>