1.隐式声明的变量总是被创建为全局变量,即使该变量 只在一个函数体内使用 <mce:script type="text/javascript"><!-- $(document).ready(function () { $('a').click(function () { GlobalScope(); document.write(scope); }); }); function GlobalScope() { scope = "区部变量"; document.write(scope); } // --></mce:script> 输出结果:区部变量区部变量 局部变量声明之后 $(document).ready(function () { $('a').click(function () { GlobalScope(); document.write(scope); }); }); function GlobalScope() { var scope = "区部变量"; document.write(scope); } 输出结果为:区部变量 2.在函数体内部,局部变量的优先级