//获取url参数 window.getParam = function(url, id) { url = url+ ""; var regstr = "/(\?|\&)" + id + "=([^\&]+)/"; var reg = eval(regstr); var result = url.match(reg); if (result && result[2]) { return result[2]; }else{ return '' } }