1. JavaScript处理get方法传过来的参数
1 <script>
2 url = location.search.substr(1);
3 if(url.length > 0) {
4 ar = url.split(/[&=]/);
5 for(i=0;i<ar.length;i+=2) {
6 document.write("参数:"+ar[i]+":"+ar[i+1]+"<br>");
7 }
8 }
9 </script>
10 <a href='?a=你好&room=awe'>test</a>
2.怎样获得本月的最后一天??
1
var
day
=
new
Date().getMonth()
+
1
;
2
var
lastday
=
new
Date(
2006
,day,
0
).getDate();
3
alert(lastday)