<script type="text/javascript">
function class(){
alert('a');
}
var a,b;
a=b=class;
//================================
做一些处理
//================================
a();//这里弹出b来
</script>
代码就是这了
不要修改a,a就是引用的class;
怎么做一些修改了

解决方案 »

  1.   

    可以认为是把
    class函数里面的内容变成
    alert('b')
      

  2.   

    建议使用参数!或者重新定义函数!另,class 是 JS 保留字,不要用做函数名!L@_@K
    function test(s){ 
    if (s)
    alert(s);
    else 
    alert("a");
    }
    var a,b; 
    a=b=test;
    a();
    a("b");
      

  3.   

     <html><head></head>
    <body>
    <iframe width="599" align="center" height="200" id="cwin" name="cwin" onload="Javascript:SetCwinHeight(this)" frameborder="0" scrolling="no" src="坐标网络排名__更多比较,更多选择.mht"></iframe></body></html>
    <script>
    function SetCwinHeight(obj)
    {
      var cwin=obj;
      if (document.getElementById)
      {
        if (cwin && !window.opera)
        {
          if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
            cwin.height = cwin.contentDocument.body.offsetHeight; 
          else if(cwin.Document && cwin.Document.body.scrollHeight)
            cwin.height = cwin.Document.body.scrollHeight;
        }
      }
    }
    </script>
     
      

  4.   

    没什么意图啊
    上次看到一个帖子
    现在找不到了  我把大概意思写下来
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml'>
    <body>
    <script>
    function A(a){
    this.A =a;
    this.AA = function(){
    alert(this.A);
    }
    }function B(b){
    this.n = A
    this.n('AAA');
    delete this.n;  //就是这个地方了
    this.ooxx=function(){alert('ooxxooxxoo')}
    }
    new B().AA()
    </script>
    </body>
    </html>上面注释的地方啊
    LZ问 为什么在这里要删除
    LX其中一个人回答  因为 this.n是引用的A函数  怕this.n会改变A函数(这是cloudgamer的回答)
    后面还有很多人也这么回答
    但是没有一个例子
    我自己测试又测试不出来
    只好拿上来问问..........