getElementsByTagName('a'),然后,把所有的<a> 的 href="javascript:return false;"这样总应当是可行的吧

解决方案 »

  1.   

    用透明层把iframe盖住。
    一个问题怎么发了两个帖子?
      

  2.   

    <iframe id="baiduIF" src="http://www.baidu.com" style="width:300px;height:400px;"> </iframe> 
    <script> 
    function getPos(o){ 
      var p=new Object(); 
      p.x=o.offsetLeft; 
      p.y=o.offsetTop; 
      while(o=o.offsetParent){ 
        p.x+=o.offsetLeft; 
        p.y+=o.offsetTop; 
      } 
      return p; 

    function $(id){return document.getElementById(id);} 
    window.onload=function(){ 
      var bd=$('baiduIF'); 
      var h=bd.offsetHeight,w=bd.offsetWidth; 
      var p=getPos(bd); 
      var =document.createElement("div"); 
      .style.zIndex=100; 
      .style.position="absolute"; 
      .style.left=p.x+"px"; 
      .style.top=p.y+"px"; 
      .style.width=w-20+"px"; 
      .style.height=h-20+"px"; 
      //======== 
      .style.filter="alpha(opacity=0)"; 
      .style.opacity="0"; 
      .style.backgroundColor="#ffffff";//ie不知道什么问题,没设置背景色不起作用,只好设置 
      document.body.appendChild() 

    </script>