<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<div style="position:absolute; left:0px; top:0px; width:100px; height:100px; z-index:1; border:1px solid #555;" >
<object classid='clsid:02A26A5E-FD68-459C-99AF-45EFF76A1C7F' onclick="alert('ff')"  VIEWASTEXT> </object>
</div>
<div style="position:absolute; left:0px; top:0px; width:100px; height:100px; z-index:10; background:#FFFFFF; filter:alpha(opacity=0); -moz-opacity:0.0;" onclick="alert(1)">
</div>
</body>
</html>

解决方案 »

  1.   

    经测试
    不行。。
    object把第二个div覆盖了
      

  2.   

    到网上搜了个方法
    <script for='PlayerR0C0' event='onclick'>alert('测试!')</script>
    <object classid='clsid:02A26A5E-FD68-459C-99AF-45EFF76A1C7F' width='200' height='200' id='PlayerR0C0' VIEWASTEXT></object>
    也不行
      

  3.   

    test.html的内容为空白
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head>
    <script type="text/javascript">
    function $(id){
    return document.getElementById(id);
    }
    window.onload = function(){
     $("frm").contentWindow.document.onclick = function(){
    alert(111);
    };
    };
    </script>
    <body>
    <div style="position:absolute; left:0px; top:0px; width:100px; height:100px; z-index:1; border:1px solid #555;" >
    <object classid='clsid:02A26A5E-FD68-459C-99AF-45EFF76A1C7F'  VIEWASTEXT> </object>
    </div>
    <div style="position:absolute; left:0px; top:0px; width:100px; height:100px; z-index:10; background:#FFFFFF; filter:alpha(opacity=0); -moz-opacity:0.0;" >
    <iframe id="frm" frameborder="0" height="100" width="100" src='test.html'></iframe>
    </div>
    </body>
    </html>
      

  4.   

    有知道有没帮助javascript响应OCX控件的事件
    <OBJECT name=aaa 
    classid="clsid:1677F2FC-05FE-4FA3-95B4-E6359B48387E"
    codebase="./ocx/ActiveFormProj1.ocx#version=1,0,6,0"
    width=350
    height=250
    align=center
    hspace=0
    vspace=0
    >
    <!-- script函数 -->
    <script type="text/javascript" Language=Javascript>
      function call(AID,AName)
      {
         alert(AID+AName);
      }
    </script> 
     <!-- 定义Delphi中访问的OnCall事件对应的Script方法 -->
    <SCRIPT type="text/javascript" FOR="aaa" EVENT="OnCall(AID,AName)" >
       <!-- insert script commands -->
       call(AID,AName);
    </SCRIPT>