一个简单的jsfunction testIE(){
 alert("hello");
}这个js是放在一个js文件里的
用火狐和chrome都能调用但是用IE就不行

解决方案 »

  1.   

    我这边可以,IE8
    html和js放在同一个目录
    <body>
    <script src="t.js"></script>
    <script>
    testIE();
    </script>
    </body>
      

  2.   

    后来查了js  里面有些判断重复了 
    比如判断一个输入的年份是否正确  var  year = document.getElementById("year").value;
    if(year.length>4){
    alert(""请输入正确的年份);
    }
    if(year==""){
    alert("请输入年份");
    }IE调用的时候就报错了 但是火狐和google都能正常运行 在IE中去掉
    if(year==""){
    alert("请输入年份");
    }就正常了