qq.toString()里面已经有document.write了,为什么还要document.write,多出的null就是你的document.write输出的

解决方案 »

  1.   

    是多出的undefined的,2楼笔误了,Sorry
      

  2.   

    function qq() 

        document.write("test or test"); 

    Function.prototype.originalToString = Function.prototype.toString; 
    Function.prototype.toString = function() 

        document.write("Change the toString function <br>"); 
    return "一个函数如果没return任何信息, 缺省情况会return一个undefined"; 
    }; 
    document.write(qq.toString())