function getParameter(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
// http://localhost:8080/controller?param1=2
getParameter('param1');// 2
var xxx = <%=request.getParameter("xx")%>?window.location.search
//window.location对象上有很多很有用的信息。
location.pathname
var xx = ${xx};
全域查找