在ie6下 不提示错误 在ie7下 提示我这js代码有错误 !

解决方案 »

  1.   

    奇怪了,
    我用IE7怎么没发现问题呀。
    不过FF3下有问题。你需要把 document.StaticLogo2 改为 StaticLogo2 ;
    或者 document.getElementById( "StaticLogo2 " );
      

  2.   

    http://www.olshine.com/xwzx.asp 看看这网站 就是右边那个动态导航 在ie6下可以 在ie7 ie8 下无法运行 
    提示 “对象不支持属性或方法  ” 
    <SCRIPT language=JavaScript> 
    function myload2() 

    if (navigator.appName == "Netscape") 

    document.StaticLogo2.pageY=50; 
    document.StaticLogo2.pageX=0; 
    //alert(document.StaticLogo.pageX) 
    mymove2(); 

    else 

    StaticLogo2.style.top=50; 
    StaticLogo2.style.right=0; 
    mymove2(); 


    document.ns = navigator.appName == "Netscape"; 
    var a2; 
    var b2; 
    var x2=0; 
    function mymove2() 

    window.screen.width>800 ? a2=20:a2=105 
    b2=window.screen.width; 
    if(document.ns) 

    document.StaticLogo2.top=pageYOffset+280+a2; 
    document.StaticLogo2.right=0; 
    setTimeout("mymove2();",1); 

    else 

    StaticLogo2.style.top=document.body.scrollTop+280+a2; 
    StaticLogo2.style.right=0; 
    setTimeout("mymove2();",1); 

    } </SCRIPT> <DIV id=StaticLogo2 
    style="Z-INDEX: 600; RIGHT: 550px; LEFT: 882px; VISIBILITY: visible; POSITION: absolute; TOP: 407px" 
    align=right> 
    <TABLE cellSpacing=0 cellPadding=0 width="100%"> 
      <TBODY> 
      <TR> 
        <TD> <IMG src="Image/neiye_10_r1_c1.gif" border=0> </TD> 
      </TR> 
      <TR> 
        <TD> <A href="alwz.asp"> <IMG 
          src="Image/neiye_10_r2_c1.gif" border=0> </A> </TD> 
      </TR> 
      <TR> 
        <TD> <A href="kfzx.asp"> <IMG 
          src="Image/neiye_10_r3_c1.gif" border=0> </A> </TD> 
      </TR> 
      <TR> 
        <TD> <A href="kfzx.asp"> <IMG 
          src="Image/neiye_10_r4_c1.gif" border=0> </A> </TD> 
      </TR> 
      <TR> 
        <TD> <A href="index.asp"> <IMG 
          src="Image/neiye_10_r5_c1.gif" 
    border=0> </A> </TD> 
      </TR> </TBODY> </TABLE> </DIV> 
    <SCRIPT>myload2(); </SCRIPT> <SCRIPT> 
    var msg = "dffd"; 
    var speed = 300; 
    var msgud = " " + msg; 
    function statusScroll() { 
    if (msgud.length <msg.length) msgud += " - " + msg; 
    msgud = msgud.substring(1, msgud.length); 
    window.status = msgud.substring(0, msg.length); 
    window.setTimeout("statusScroll()", speed); 

    </SCRIPT>
      

  3.   

    http://www.olshine.com/xwzx.asp 看看这网站 就是右边那个动态导航 在ie6下可以 在ie7 ie8 下无法运行 
    提示 “对象不支持属性或方法  ” 
      

  4.   

    StaticLogo2.style.top=document.body.scrollTop+280+a2; 
    StaticLogo2.style.right;ie7下提示 是这地方问题
      

  5.   

    音乐挺COOL的,
    IE7下没有发现有报错。
    IE8不知道。
      

  6.   

    document.StaticLogo2.pageY=50;
    document.StaticLogo2.pageX=0;
    FF3.0下就已经提示你这个错误了!!
      

  7.   

    <script> 
    window.onerror = function(sMessage, sUrl, sLine){ //捕捉错误 
    alert(sMessage + "---------" + sUrl + "-----------" + sLine);  
    return true;  
    }  
    </script> 
    请在你的JS前面加上这个JS来判断你的JS错误
    你就能知道你错误的是在哪了
      

  8.   

    建议你都改成document.getElementById( "StaticLogo2 " )
      

  9.   

    StaticLogo2.style.right=0;  捕捉到了 提示是这行有错误
      

  10.   

    document.getElementById("StaticLogo2 ").style.right=0;
    这样才兼容的啦
      

  11.   

    StaticLogo2.style.right=0; 就是提示这行错误啊
      

  12.   

    IE7下也出错吗?你试试 这样写看看。StaticLogo2.style.right="0px";