JS加解密URL参数encodeURIComponent() decodeURIComponent()
参考1:http://www.w3school.com.cn/js/jsref_encodeURIComponent.asp
参考2:http://www.w3school.com.cn/js/jsref_decodeURIComponent.asp
实例:
<script type="text/javascript"> var test1="http://www.w3school.com.cn/My first/" document.write(encodeURIComponent(test1)+ "<br />")
document.write(decodeURIComponent(test1)) </script>
输出:
http%3A%2F%2Fwww.w3school.com.cn%2FMy%20first%2F
http://www.w3school.com.cn/My first/
JS加解密URL参数encodeURIComponent() decodeURIComponent()的更多相关文章
- js_html_input中autocomplete="off"在chrom中失效的解决办法 使用JS模拟锚点跳转 js如何获取url参数 C#模拟httpwebrequest请求_向服务器模拟cookie发送 实习期学到的技术(一) LinqPad的变量比较功能 ASP.NET EF 使用LinqPad 快速学习Linq
js_html_input中autocomplete="off"在chrom中失效的解决办法 分享网上的2种办法: 1-可以在不需要默认填写的input框中设置 autocompl ...
- JS对象转URL参数(原生JS和jQuery两种方式)
转自:点击打开链接 现在的js框架将ajax请求封装得非常简单,例如下面: $.ajax({ type: "POST", url: "some.php", da ...
- js如何获取url参数
匹配URL参数的正则是: var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", ...
- js获取当前url参数
//抓取url参数 function GetRequest() { var url = location.search; //获取url中"?"符后的字串 var theReque ...
- JS页面跳转加密解密URL参数
页面跳转加密参数 window.location.href="foot.html?"+btoa(encodeURIComponent("goodid="+goo ...
- js加解密字符串
项目中经常会有url带参并取参数值的问题,最常见的就是登录后再回到原来的页面redirect_uri,我们通常会使用 encodeURIComponent() 转码,当然简单的可以这样使用,如果涉及到 ...
- Js获取指定Url参数
在 C#.PHP.JSP 中,都有直接获取 Url 中指定参数的方法,但 Javascript 却没有这样的现在方法,得自己写一个.在 Web 的开发过程中,获取 Url 中的参数是十分常用的操作,所 ...
- js获取当前url参数的两方式
方法一:正则分析法function getQueryString(name) { var reg = new RegExp("(^|&)" + name + &quo ...
- js正则获取url参数,包含hash[#]和search[?]两种通用
function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&] ...
随机推荐
- CAKeyframeAnimation
之所以叫做关键帧动画是因为,这个类可以实现,某一属性按照一串的数值进行动画,就好像制作动画的时候一帧一帧的制作一样. 一般使用的时候 首先通过 animationWithKeyPath 方法 创建一 ...
- 帮同事写了几行代码,在 安装/卸载 程序里 注册/卸载 OCX控件
写了个小控制台程序,这个程序用来注册 / 卸载OCX控件,用在Inno Setup做的安装卸载程序里. #include "stdafx.h" #include <windo ...
- [GRYZ2015]Graph
题目描述 给出 N 个点,M 条边的有向图,对于每个点 v,求 A(v) 表示从点 v 出发,能到达的编号最大的点. 输入格式 第 1 行,2 个整数 N,M. 接下来 M 行,每行 2 个整数 Ui ...
- springmvc的一些优化设置
1.配置文件的优化: 无需使用 <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotatio ...
- LNMP最新源码安装脚本(定期更新)
Linux+Nginx+MySQL+PHP+Pureftpd+User manager for PureFTPd,脚本中用到的软件包大多最新版本,修复了User manager for PureFTP ...
- 扩展KMP--求字符串S的所有后缀和字符串T的最长公共前缀
在解上面这个问题前我们要先解决一个类似的问题:求字符串s的所有后缀和s本身的最长公共前缀: 我们用next[]数组保存这些值: 现在我们假设要求next[ x ],并且next[ i ] 0<i ...
- UVA 315 315 - Network(求割点个数)
Network A Telephone Line Company (TLC) is establishing a new telephone cable network. They are con ...
- hdu4505小Q系列故事——电梯里的爱情
小Q系列故事——电梯里的爱情 Time Limit: 300/100 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Tota ...
- C++中使用函数指针 【瓦特芯笔记】
在C++类中使用函数指针. 类型定义: typedef 返回类型(类名::*新类型)(参数表) //类定义 class CA { public: char lcFun(int a) ...
- POJ 3169 Layout (spfa+差分约束)
题目链接:http://poj.org/problem?id=3169 差分约束的解释:http://www.cnblogs.com/void/archive/2011/08/26/2153928.h ...