<script type="text/javascript">?function reinitIframe(v_val) { var iframe = document.getElementById(v_val); try { var bHeight = iframe.contentWindow.document.body.scrollHeight; var dHeight = iframe.contentWindow.document.documentElement.scrollHeight; var height = Math.min(bHeight, dHeight); iframe.height = height; }? catch (ex){}}window.setInterval("reinitIframe('autoframe')", 200);?</script>我有三個問題:1.為什么要用try {...}catch (ex){} ?這個有什么作用呢?2.為什么window.setInterval("reinitIframe('autoframe')", 200); 改成reinitIframe('autoframe') 就沒效果?3.如何兼容360和火狐瀏覽器?請各位老師指導,謝謝~
iframe自適應高度 如何兼容360和火狐瀏覽器
Sunshine518
2014-09-22 17:03:52