本帖最后由 hehe04 于 2012-8-29 19:30 编辑
我这段代码无法运行,很奇怪 不知道问题出在哪里了 ,麻烦各位帮忙看看。- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head>
- <title></title>
- <script type="text/javascript">
- var arr2 = new Array();
- arr[0] = 1;
- arr[1] = 2;
- arr[2] = 3;
- arr[3] = 4;
- for (var i = 0; i < arr2.length/2; i++) {
- var temp;
- temp = arr2[i];
- arr2[i] = arr2[arr2.length - i - 1];
- arr2[arr2.length - i - 1] = temp;
- }
- for (var i = 0; i < length; i++) {
- alert(arr2[i]);
- }
- </script>
- </head>
- <body>
- 12321321321321321321321321
- </body>
- </html>
复制代码 |