我遇到了代码变量名称相互冲突的问题,即;
<script type="text/javascript">var a = "hello"; </script>
<script type="text/javascript">alert(a);//this works, when I want 'a' not to exist </script>
关闭是唯一的选择吗?
来自ac#背景,就像是构造一个未引用的delegate实例,然后调用它inline,看起来有点乱
(function(){var a = "hello";})();
(function(){alert(a);})();//yes! working as expected