zoukankan      html  css  js  c++  java
  • js获取URL地址某个参数数据

    function closeThis()
    {
        var paraName = URL_Request("UploadPanelName");
     var cm=window.parent.document.getElementById(paraName);
     if (cm.style.visibility=="visible")
     {
      cm.style.visibility = "hidden";
     }
    }


    function URL_Request(strName)
    {
       var strHref = document.location.toString();
       var intPos = strHref.indexOf("?");
       var strRight = strHref.substr(intPos + 1);//==========获取到右边的参数部分
       var arrTmp = strRight.split("&");//=============以&分割成数组
       for(var i = 0; i < arrTmp.length-1; i++ ) //===========循环数组
       {
         var dIntPos = arrTmp[i].indexOf("=");
         var paraName= arrTmp[i].substr(0,dIntPos);
         var paraData= arrTmp[i].substr(dIntPos+1);
       
         if(paraName.toUpperCase() == strName.toUpperCase())
         {
            return paraData;
          }
       }
       return "";
    }
      </script>

  • 相关阅读:
    smb 共享文件夹
    php nginx 配置
    mysql 存储过程
    ubuntu 源码下载分析
    rust 小米R3G官方rom(openwrt) openssl
    rust 配置
    mac 制作树莓派3b启动盘
    小米R2D
    golang 配置
    golang pprof操作流程
  • 原文地址:https://www.cnblogs.com/kingeric/p/631013.html
Copyright © 2011-2022 走看看