工具类 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;
    },

 

posted @ 2013-08-19 18:01  x.radish  阅读(216)  评论(0编辑  收藏  举报