<c:if test="条件"><OBJECT id="test" 
  classid="clsid:882D7A5B-DDD5-4732-978C-73E9DECC0EA5"   codebase="http://192.168.1.201:8080/test.ocx#version=1,0,0,0"                    
  width=" <%out.print(width);%>" 
  height=" <%out.print(height);%>" 
  align=center 
  hspace=0 
  vspace=0 

</OBJECT> </c:if>
js先设置<OBJECT>style属性display=false 
<script>
if(条件)document.getEmementById("obj").style.display='true';
</script>

解决方案 »

  1.   

    <script>  
    function CallAx() 
    {          
          document.getElementById("test").style.width=10px; 
          document.getElementById("test").style.height=10px; 
    }  
    </script> 
    <script>setTimeout("CallAx()","5000") </script>    运行后提示缺少对象!
      

  2.   

    document.all.objname.style.display = "none";
      

  3.   

    OBJECT 外面套个DIV
    默认STYLE=“display:none”当满足条件时 document.getElementById(DIV的ID).style.display="";
    6楼的是个不考虑浏览器兼容的
      

  4.   

    if(true)
     document.getElementById('test').style.display='block'; 
    else
     document.getElementById('test').style.display='none';