js通过html的url获取参数值

function getUrlParameter(name){
        name = name.replace(/[]/,"\[").replace(/[]/,"\[").replace(/[]/,"\\\]");
        var regexS = "[\\?&]"+name+"=([^&#]*)";
        var regex = new RegExp( regexS );
        var results = regex.exec(window.parent.location.href );
        if( results == null ) return ""; else {
            return results[1];
        }
    };
http://localhost:8080/pcms/moduleApp/indexControl.html?conferId=117

var conferid =getUrlParameter('conferId');

 

posted @ 2019-09-07 18:47  小泉哥  阅读(6049)  评论(0编辑  收藏  举报