父窗口jquery触发iframe按钮事件(转载)

原文地址: http://blog.csdn.net/muziduoxi/article/details/11123923

 

<script type="text/javascript">
$(document).ready(function(e){
      var iframe = document.getElementById("Box"); 
    if (iframe.attachEvent) { 
        iframe.attachEvent("onload", function() { 
                    //以下操作必须在iframe加载完后才可进行 
            alert('1');
        }); 
    } else { 
        iframe.onload = function() { 
                    //以下操作必须在iframe加载完后才可进行 
           $("#Box").contents().find("#btn1").click(function(e){alert('0000133');$("#test").val("00000000000000000");return false;});//jquery 方法1 
        }; 
    } 
 
</script>

posted @ 2015-07-30 16:58  静思长远  阅读(620)  评论(0编辑  收藏  举报