js获取地址栏参数方法 屡试不爽

   function  getUrlParam (key) {
        var result = location.search.match(new RegExp("[\?\&]" + key + "=([^\&]+)", "i"));
        if (result == null || result.length < 1) {
            return "";
        }
        return result[1];
    }

猜你喜欢

转载自blog.csdn.net/m0_37633370/article/details/80826584