2012年4月8日
摘要: concat() //给数组添加元素var a=[1,2,3];a.concat(4,5) //返回【1,2,3,4,5】a.concat([4,5]) //返回【1,2,3,4,5】a.concat([4,5],[6,7]) //返回【1,2,3,4,5,6,7】a.concat(4,[5,[6,7]]) //返回【1,2,3,4,5,[6,7]】join() //把数组转化成字符串a=new Array(1,2,3,"sgdsgahg");s=a.join("+");alert(s); //显示1... 阅读全文
posted @ 2012-04-08 22:19 逍遥叹 阅读(137) 评论(0) 推荐(0) 编辑
摘要: window.open();var w= window.open("smallwin.html","smallwin","width=400,height=100,status=yes,resizable=yes"); 第一个参数是要在新窗口中显示的文档的URL第二个参数是新打开的窗口的名字,这个名字可以作为<a>标记或<form>标记的target属性的值,如果指定的是一个已经存在的窗口的名字,那么open()使用的就只是那个已经存在的窗口,而不是再打开一个新窗口。第三个参数是特性列表,这些特性声明了窗口的大 阅读全文
posted @ 2012-04-08 20:06 逍遥叹 阅读(148) 评论(0) 推荐(0) 编辑
摘要: <script> var abc=function(x){ if(x<2) return 1; else return x*arguments.callee(x-1); } var y=abc(5); alert(y);</script> 参数检验<script> function check(args){ var actual=args.length; //实际的参数长度 var expected=args.callee.length; //期待的参数长度 if (actual!=e... 阅读全文
posted @ 2012-04-08 19:40 逍遥叹 阅读(205) 评论(0) 推荐(0) 编辑