摘要: JavaScript中的全局变量与局部变量 <script type="text/javascript"> for(var x=0; x<3; x++){//在脚本片段中定义的变量,是全局变量。 document.write("x="+x); } function show(){ var x = 6 阅读全文