方法一decodeURI() 函数可对 encodeURI() 函数编码过的 URI 进行解码原理如下script typetext/javascript var test1http://www.w3school.com.cn/My first/ document.write(encodeURI(test1) br /)//编码 document.write(decodeURI(test1))//解码 /scripthttp://www.w3school.com.cn/My%20first///编码之后的结果 http://www.w3school.com.cn/My first///解码之后的结果实现方法如下ar getParam function (name) { var r new RegExp((\?|#|) name ([^#\?]*)(|#|$|\?)); var m window.location.href.match(r);//正则表达式匹配返回的是一个数组 return decodeURI(!m ? : m[2]); };方法二这个方法是将所有存储的cookie都存入一个对象返回整个对象function deal(){ var cookie document.cookie; var arr cookie.split(;); var obj {}; arr.forEach(function(item){ var itemArr item.split(); obj[itemArr[0]] itemArr[1]; }) return obj; }方法三这个方法返回的是参数对应的cookiefunction getCookie(name){ var arr document.cookie.split(;); for(var i 0;iarr.length;i){ var arrName arr[i].split(); if(arrName[0] name){ return arrName[1]; } } return ; }
相关新闻
【Bug已解决】vllm process crashed because of dp coordinator receives unexpected message... 解决方案
【Bug已解决】vllm process crashed because of dp coordinator receives unexpected message... 解决方案
一、现象长什么样
在 vLLM 的**数据并行(DP)**部署里,负责协调整个 DP 组的「DP coordinator」进程,收到一条「不符合预期…
告别臃肿!3步让你的暗影精灵笔记本重获新生 【免费下载链接】OmenSuperHub Control Omen laptop performance, fan speeds, and keyboard lighting, and unlock power limits. 项目地址: https://gitcode.com/gh_mirrors/om/OmenSuperHub
你是否也曾为官方Om…