jquery获取url传值里的参数

比如链接https://www.jianshu.com/writer#/notebooks/21621288/notes/29391753
我想获取29391753这个值
【jquery获取url传值里的参数】如下现写一个正则表达式:
String.prototype.getQuery = function(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = this.substr(this.indexOf("\?") + 1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
然后获取值:
var strHref = https://www.it610.com/article/this.location.href;
var ProjectCD = strHref.getQuery("ProjectCD");
现在ProjectCD 就等于29391753

    推荐阅读