/**
*
* 获取url中的参数值
* @param {String} name url中对应的参数名称
* @param {String} url url参数
*/
function getUrlParam(name, url) {
if (!url) url = location.href;
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( url );
return results == null ? null : results[1];
}
var url="https://mp.weixin.qq.com/cgi-bin/appmsgcopyright?action=orignal&type=1&lang=zh_CN";
var action = getUrlParam("lang",url)
console.log(action);
console