/** * Created by GYX on 2016/12/16. * 说明:获取url中的参数 */var getUrlParam = { param : function(name) { var url = location.href; var paraString = url.substring(url.indexOf("?")+1,url.length).split("&"); var paraObj = {}; for (i=0; j=paraString[i]; i++){ paraObj[j.substring(0,j.indexOf("="))] = j.substring(j.indexOf("=")+1,j.length); } var returnValue = paraObj[name]; if(typeof(returnValue)=="undefined"){return "";}else{return returnValue;} }}/*key 为所需要接收的参数名字*/getUrlParam.param('key')