請問一下各位, javascript 或 jquery 可否等判斷iframe載入完畢, 程式如下
#file.php
<iframe src="http://127.0.0.1/demo.php" frameborder="1" id="do" name="do">
</iframe>
<script>
$('#do').on('load', function(){
console.log('load the iframe ... ')
});
</script>
#demo.php
<body onload = "document.getElementById('FORM').submit();">
<form action="demo_1.php" name="demo" name="FORM" id="FORM">
<input type="submit" name="b1" style="display:none">
</form>
</body>
#demo_1.php
<? header('Location: http://127.0.0.1/demo_2.php'); # 轉址到demo_2.php ?>
demmo_2.php
<?
sleep(5); # 睡5秒
echo "demo_2_end";
?>
所以程式流程是 : file.php