以下代码不能兼容高速浏览器,麻烦高手帮帮忙,感谢大家指点一下.
<script language="javascript"> function show(str,strs)
{
if (document.getElementById(str).checked==true)
{document.getElementById(strs).style.display="block";}
else
{document.getElementById(strs).style.display="none";}
}function jumpwindow(i){   
  document.all.bodyly.style.display="block";   
  document.all.bodyly.style.width=document.body.clientWidth+"px";   
  document.all.bodyly.style.height=document.body.clientHeight+"px"; 
  document.getElementById("jumply"+i).style.display='block'; 
  document.getElementById("jumply"+i).style.top=(document.documentElement.scrollTop+40)+"px";   
  document.getElementById("jumply"+i).style.left=(document.body.clientWidth/2-250)+"px";  
  }   
function unwindow(i){
  document.getElementById("jumply"+i).style.display='none';
  document.all.bodyly.style.display="none";
  } </script>

解决方案 »

  1.   

    bodyly是什么东东.document.all尽量避免不要使用document.all.bodyly.style.display="block";   
    改成:
    document.getElementById("bodyly").style.display="block";   
      

  2.   

    document.all
    这个是IE独有的东东,你直接用它来获取元素,基本上不是说兼容的问题了,而是所有非IE标准浏览器都无法实现
      

  3.   

    <script language="javascript"> 看这个标签 就是 很早的 代码阿应该是 all的不兼容
      

  4.   

    2楼说的方法,以前试过,还是不行.function show(str,strs)
    {
    if (document.getElementById(str).checked==true)
    {document.getElementById(strs).style.display="block";}
    else
    {document.getElementById(strs).style.display="none";}
    }
    应该是这段代码需要调整.
    主要按钮点击无法展开隐藏的内容.
    <input type="checkbox" name="education" id="education" value="1" onclick="javascript:show('education','educationcon');" />这个是按钮代码.所有代码在IE6都是正常能用的.
      

  5.   

    1:先说你上面的代码问题。如果你的id=education的checkbox有且仅有一个,那么使用上面的代码是没有问题的2:大家都跟你说了document.all存在兼容性问题。我不知道你说的以前试过不行是怎么个情况。但你这次试了吗?
    if(document.all){
        alert(1)
    }else{
        alert(2)
    }
    拿着上面的代码,在IE和非IE下试试去,看看是什么效果。你不信我们的么有关系的,眼见为实吧,事实总能说明情况了吧?
    我一般有需要的时候都直接拿document.all去区分是不是IE浏览器了
      

  6.   

    document.all只能在IE上,告诉浏览器估计用的是Chrome的内核
      

  7.   

    function show(str,strs)
    {
    if (document.getElementById(str).checked==true)
    {document.getElementById(strs).style.display="block";}
    else
    {document.getElementById(strs).style.display="none";}
    }
    <!--
    if (document.getElementById("education").checked==true)
    {
      if (fnRemoveBrank(theForm.edu_start_year.value) == "0")
      {
        alert("请选择");
        theForm.edu_start_year.focus();
        return (false);
      }
      if (fnRemoveBrank(theForm.edu_edu.value) == "")
      {
        alert("请选择学历!");
        theForm.edu_edu.focus();
        return (false);
      }
    }
    function jumpwindow(i){   
      document.getElementById("bodyly").style.display="block"; 
      document.getElementById("bodyly").style.width=document.body.clientWidth+"px";
      document.getElementById("bodyly").style.height=document.body.clientHeight+"px";
      document.getElementById("jumply"+i).style.display='block'; 
      document.getElementById("jumply"+i).style.top=(document.documentElement.scrollTop+40)+"px";   
      document.getElementById("jumply"+i).style.left=(document.body.clientWidth/2-250)+"px";  
      }   
    function unwindow(i){
      document.getElementById("jumply"+i).style.display='none';
      document.getElementById("bodyly").style.display='none'; 
      } 
    -->
    </script>
    <input type="checkbox" name="education" id="education" value="1" onclick="javascript:show('education','educationcon');" />这个是按钮代码.
    在ie下都能正常运行,其它的浏览器就是(点击按钮不能展开内容)主要是这个问题!
      

  8.   

    其实关于js的输入,如果考虑到游览器的兼容新,jquery是个不错的方案,如果jquery写的代码,你的游览器都不能运行,1,代码有错,2 就是你的游览器有问题,还有什么事高速游览器,360的?