问题 G: JS Window 时间限制: 2 Sec 内存限制: 512 MB 题目描述 JSZKC has an array A of N integers. More over, he has a Window of length M which means the Window can contain M continuous integers in the array. At the begging, the Window is at the position 1 which mea
平时做项目 经常需要使用window.onload, 用法如下: function func(){alert("this is window onload event!");return;} window.onload=func; 或者如下: window.onload=function(){alert("this is window onload event!");return;} 但window.onload 不能同时加载多个函数. 比如: function t
原文链接:http://blog.csdn.net/zyz511919766/article/details/7276089# 今天公司一个实习小妹子问我两段JS代码的区别: <script type="text/javascript"> var a = "Hello"; function test(){ var a; alert(a); a = "World"; alert(a); } </script> <scr
<script> var i=10; //全局变量 j = 20; //全局变量 function(){ var i=30; //局部变量 h = 40; //全局变量 } </script> 由此可以总结一句话,在函数内部定义的就是局部变量,否则就是全局变量. <script> var i =10; function display(){ //var i = 20;//局部变量只在局部作用域起作用 i= 30; //全局的,会将i的值修改为30 } alert(i);