近来学习ExtJS2,学到不少东西,其用到的静态类是这样写的: B = function() { var s = "aaaaa"; return { sayhello : function() { alert(s); } }}();B.sayhello();