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');

猜你喜欢

转载自www.cnblogs.com/penghq/p/11482287.html