jQuery: How to get parameters of a url?

后端 未结 8 835
离开以前
离开以前 2020-12-05 07:42

New to jQuery and I\'m having trouble getting the parameters of a url that my server generates. I have a url like this:



        
8条回答
  •  温柔的废话
    2020-12-05 08:17

    function getURLParameter(name) {
        return decodeURI(
            (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
        );
    }
    

提交回复
热议问题