url获取参数值,支持中文、英文

        //获取url的参数,支持中文和英文
        function getQuery(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return decodeURI(r[2]); return null;
        }

猜你喜欢

转载自www.cnblogs.com/wxy520/p/11732118.html