escape,encodeURI,encodeURIComponent的区别
escape是对字符串进行编码而另外两种是对URL。
encodeURI方法不会对下列字符编码 ASCII字母 数字 ~!@#$&*()=:/,;?+'
encodeURIComponent方法不会对下列字符编码 ASCII字母 数字 ~!*()'
encodeURIComponent比encodeURI编码的范围更大。
1.编码字符串,用escape()。
2.编码url,且该url需要使用,用encodeURI,http://,encodeURIComponent(http://')=='http%3A%2F%2F',这个url拼接的网址已经不能正常访问。
如果需要编码url中参数,那么encodeURIComponent()是最好的
escape,encodeURI,encodeURIComponent的区别的更多相关文章
- Flex中escape/encodeURI/encodeURIComponent的区别
Flex中提供了三种转码函数,各有各的区别, escape,encodeURI,encodeURIComponent 这三个函数不仅在flex中有道运用在javascript中同样的含义 ,今天我仔细 ...
- url的三个js编码函数escape(),encodeURI(),encodeURIComponent()简介
url的三个js编码函数escape(),encodeURI(),encodeURIComponent()简介 2014年10月12日 16806次浏览 引子 浏览器URl地址,上网一定会用到,但是浏 ...
- escape,encodeURI,encodeURIComponent
JavaScript/js中,有三个可以对字符串编码的函数,分别是: escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,d ...
- url的三个js编码函数escape(),encodeURI(),encodeURIComponent()简介【转】
引子 浏览器URl地址,上网一定会用到,但是浏览器地址有中文或者浏览器url参数操作的时候,经常会用到encodeURIComponent()和decodeURIComponent()以及encode ...
- JavaScript中有三个可以对字符串编码的函数,分别是: escape(),encodeURI(),encodeURIComponent()
JavaScript中有三个可以对字符串编码的函数,分别是: escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,decod ...
- JavaScript中有对字符串编码的三个函数:escape,encodeURI,encodeURIComponent
JavaScript中有三个可以对字符串编码的函数,分别是: escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,decod ...
- escape,encodeURI,encodeURIComponent函数比较
escape,encodeURI,encodeURIComponent函数比较 js对文字进行编码涉及3个函数:escape,encodeURI,encodeURIComponent,相应3个解码函数 ...
- JavaScript escape encodeURI encodeURIComponent() 函数
总结一下: 1.encodeURI(),和encodeURIComponent()是对字符进行编码. 2.decodeURI(),和decodeURIComponent()是对相应编码过的字符进行解码 ...
- escape encodeURI encodeURIComponent区别
escape() 函数可对字符串进行编码,这样就可以在所有的计算机上读取该字符串.使用unescape来解码. 有效的URI(统一资源标示符)是不能包含某些字符的,如空格,所以需要进行编码,编码方法有 ...
随机推荐
- spring Quartz多个定时任务的配置
Quartz多个定时任务的配置 1,配置文件与spring整合,需要在spring 的总配置中一入或者在web.xml中spring监听中加上 ztc_cp-spring-quartz.xml 注:定 ...
- DataTable select根据条件取值
1.封装独立方法 // 执行DataTable中的查询返回新的DataTable /// </summary> /// <param name="dt">源 ...
- <%#Eval if判断用法
1.绑定Repeater 基础用法 <%#Eval("RoleID")%> 2.简单判断用法 <td> <%# Convert.ToBoolean(E ...
- eclipse 搭建python环境
1.安装eclipse + jdk windows下面就直接下载,双击安装就完了. Linux下: 安装eclipse: 安装完之后,可直接运行eclipse: 快捷方式在: 安装jidk: 2. ...
- Received an invalid response. Origin 'null' is therefore not allowed access
Received an invalid response. Origin 'null' is therefore not allowed access. 今天在做二级联动,使用ajax请求xml数据, ...
- 错误:ORA-28009: connection as SYS should be as SYSDBA or SYSOPER 的解决办法--转载但验证过后可以用
今天,用iSQL*Plus 以sys用户连接数据库的时候报ORA-28009:connection as sys should be as sysdba or sysoper的错误,不知道是怎么回事, ...
- 用VBox虚拟机安装Android 屏幕90度翻转竖屏设置
在虚拟机中安装好Android之后,有一些Android应用(比如UC浏览器.UC桌面)不能安装.但更有一些程序是可以安装,却自动顺时间旋转了90度,操作和看起来非常不爽! 这个情况下,在Androi ...
- AgileEAS.NET SOA 中间件平台5.2版本下载、配置学习(四):开源的Silverlight运行容器的编译、配置
一.前言 AgileEAS.NET SOA 中间件平台是一款基于基于敏捷并行开发思想和Microsoft .Net构件(组件)开发技术而构建的一个快速开发应用平台.用于帮助中小型软件企业建立一条适合市 ...
- redis数据类型之—Hash
(1)hash 简单介绍 hash类型适合存储对象,字段值只能是字符串,不支持其他数据类型. (2)hash 常用命令 // 增加hash属性值 > hset user: name zm (in ...
- npm-bluebird使用
API 注意 时刻注意return; 使用Promise.promisify简化对test(val, function(err, result){})的处理; 尽量避免使用deferred objec ...