当前位置:编程学习 > JS >>

js 获取URL参数

function getUrlParameterAdv(asName,lsURL){
        var loU = lsURL.split( "?");
        if(loU.length> 1){
          var loallPm = loU[1].split( "&");
          for(var i=0; i < loallPm.length; i++){
            var loPm = loallPm[i].split( "=");
            if(loPm[0]==asName){
              if(loPm.length> 1){
                return loPm[1];
              }else{
                return "";
              }
            }
          }
        }
        return null;
    }
补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,