Get escaped URL parameter

后端 未结 19 2673
小蘑菇
小蘑菇 2020-11-21 13:41

I\'m looking for a jQuery plugin that can get URL parameters, and support this search string without outputting the JavaScript error: \"malformed URI sequence\". If there is

19条回答
  •  无人共我
    2020-11-21 13:54

    function getURLParameters(paramName) 
    {
            var sURL = window.document.URL.toString();  
        if (sURL.indexOf("?") > 0)
        {
           var arrParams = sURL.split("?");         
           var arrURLParams = arrParams[1].split("&");      
           var arrParamNames = new Array(arrURLParams.length);
           var arrParamValues = new Array(arrURLParams.length);     
           var i = 0;
           for (i=0;i

提交回复
热议问题