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

function getURLParam(name) {
        return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)', "ig").exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null;
    }
posted @ 2015-08-26 21:21  饶总真坏  阅读(1736)  评论(0编辑  收藏  举报