工具类 Util.Browser

    /**
     * @description get the param form browser
     * @author xf.radish
     * @param {String} key the param your want to get
     * @return {String}
     */
    getUrlParam:function(key){
        var reg = new RegExp("(^|&)" + key+ "=([^&]*)(&|$)", "i"),
        r = window.location.search.substr(1).match(reg);
        if (null != r) return r[2]; return null;
    },
原文地址:https://www.cnblogs.com/x-radish/p/3268380.html