js获取url上的参数值

 getUrlKey: function (name) {
                return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null;
            }
 $(function(){
        idcard = getUrlKey("idcardno");
        password = getUrlKey("password");
    });

 

posted @ 2019-06-27 17:42  zexzhang  阅读(293)  评论(0编辑  收藏  举报