你可以参考http://community.csdn.net/Expert/topic/4754/4754449.xml?temp=.6579706

解决方案 »

  1.   

    不是event.keyCode==13出错,该句执行是document.getElementById("say").value="";出错
      

  2.   

    function submit_say(event,domain){
        var oSay = document.getElementById("say");
        if( event.keyCode==13 || oSay.value.length!=0 ){
        getGiftFromServer(domain+"/say.php?say_value="+oSay.value);
        oSay.value="";
        }
    }
      

  3.   

    调试的时候可以在if之前插入:
    alert(oSay);
    alert(oSay.tagName);
      

  4.   

    就是event.keyCode==13出错,FF下的Event对象不能这样使用
      

  5.   

    我说了不是这一句出错
    去掉document.getElementById("say").value="";这一句就不出错了
      

  6.   

    因为在调用函数的地方已经将event传过来了,所以不是event的错以下方法已经调试通过了:function submit_say(event,domain){
        var oSay = document.getElementById("say");
        alert(oSay);
        alert(oSay.tagName);
        if( event.keyCode==13 || oSay.value.length!=0 ){
            //getGiftFromServer(domain+"/say.php?say_value="+oSay.value);
            oSay.value="";
        }
    }