darasion
V2EX  ›  问与答

警告框里弹出的是什么?

  •  
  •   darasion · Mar 6, 2011 · 4885 views
    This topic created in 5721 days ago, the information mentioned may be changed or developed.
    <script>
    var obj={};
    obj.a=function(){
    (function(){
    alert(this);
    })();
    }
    obj.a();
    </script>
    4 replies  •  1970-01-01 08:00:00 +08:00
    Yeasiz
    Yeasiz
    Mar 6, 2011
    1
    this ?
    chone
    chone
    Mar 6, 2011
    2
    window.document
    chone
    chone
    Mar 6, 2011
    3
    @chone 不对说错了,我的意思是指window这个对象
    apoclast
    apoclast
    Mar 8, 2011
    4
    还要看在哪个闭包里跑吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2944 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 00:40 · PVG 08:40 · LAX 16:40 · JFK 19:40
    ♥ Do have faith in what you're doing.