this.alert是什么意思啊?
什么时候会是false呢?
谢谢大家

解决方案 »

  1.   

    要看上下文是什么,如果this是window对象,那么if(this.alert) 成立,其他的要看是否自定义了alert
      

  2.   

    如果没有特定定义的话,就是window.alert  
      

  3.   

    this总是指向当前对象,会变化的
      

  4.   

    <script>
    function test(){
       alert(this.alert);
    }
    function ttt(){
    tt.$();
    }
    var tt = {
    $:test
    }
    </script>
    <button onclick="ttt()">tttttttttt</button>
    如果这样用会显示undefined
    首先要看当前上下文环境,才能判断this的范围,一般情况下this.alert就是调用了window对象的alert