尽量限制JS变量作用域是局部的 大家(至少是我)习惯这么写js吗? 这样暴露了变量作用域成为整个页面,扩大了变量冲突的可能:
<script language="javascript"> (function(t){ alert(t);})('hello world!');</script>