document.getElementById( "mm ").onmouseover=function()   {alert(this.b.x)}; 这里的this指的实际是document.getElementById( "mm ")你的意思是想要 执行document.getElementById( "mm ").b.x吗?

解决方案 »

  1.   

    如果实在需要这样去干,那么可以这样:function kk(a)
    {
       ad = this;
       this.b = a;
       document.getElementById("mm").onmouseover=function() {alert(a.x)};
       //document.getElementById("mm").onmouseover=function() {alert(ad.b.x)};
    }
      

  2.   


    如果实在需要这样去干,那么可以这样: function   kk(a) 

          ad   =   this; 
          this.b   =   a; 
          document.getElementById( "mm ").onmouseover=function()   {alert(a.x)}; 
          //document.getElementById( "mm ").onmouseover=function()   {alert(ad.b.x)}; 

    -----------------------------------
    tantaiyizu 你回答的很好。。要是能给在来个 Var就更完美了。。就成局部变量了。。
    而document.getElementById( "mm ").onmouseover=function()   就变成内嵌函数了。。它就能用了。。
    我想给你分。。可是找了半天没找到。。