js获取?后面具体参数的值

function getURLParam(name) {
        return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)', "ig").exec(location.search) || [, ""])[1].replace(/+/g, '%20')) || null;
    }
原文地址:https://www.cnblogs.com/raoyunxiao/p/4761690.html