方法:
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.slice(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
调用:
var id = getUrlParam('id');
方法:
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.slice(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
调用:
var id = getUrlParam('id');