onclick="fGoto()" 其实就像 
onclick_function()
{
 fGoto();
}
这样的话,他的指针是没有指向 onclick 里的 this 的
onclick=fGoto; 
他等价于 onclick_function

解决方案 »

  1.   

    我想可能第一个情况相当于document.getElementById("alink").onclick = function(){ fGoto(); } 
      

  2.   

    楼上的理解是正确的,第一种情况是直接引用了fGoto这个函数,
    考虑闭包,此时fGoto的this对象指的是window对象,window对象没有tag这个属性所以报错。
    <A href="#" onclick="fGoto(this)">** </A> 
    <script type="text/javascript"> 
    function fGoto(){ 
      alert(this.tagName);  
    }
    这样就ok了吧 
      

  3.   

    支持 yfcomeon。
    这个程序最简单的写法是:
    <a href="#" onclick="fGoto(this)">** </a>
    <script type="text/javascript">
    <!--
    function fGoto(tag)
    {
        alert(tag.tagName);
    }
    -->
    </script>
      

  4.   

    btbtd 、cloudgamer、yfcomeon 回答的很明白~ 
    谢谢你们三个。
      

  5.   

    GOOD
    apply是什么 接收当前对象?