在javaScript中变量使用var声明的变量是当前做用域的变量,不使用var声明的则确定是全局变量。java
http://msdn.microsoft.com/zh-cn/library/dn645450.aspxip