<a>标签的href传参带中文

function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
}
getQueryString('RWJDSSBM')

function getUrlParms(name){
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)
        return decodeURI(r[2]);
    return null;
}
decodeURI(getUrlParms('RWJDSSBM'))

 

posted @ 2022-10-27 17:52  尧荣华  阅读(60)  评论(0编辑  收藏  举报