免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 43513 | 回复: 8
打印 上一主题 下一主题

get传递url中的特殊字符 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-01-09 18:30 |只看该作者 |倒序浏览
escape不编码字符有69个:*,+,-,.,/,@,_,0-9,a-z,A-Z
encodeURI不编码字符有82个:!,#,$,&,',(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z
encodeURIComponent不编码字符有71个:!, ',(,),*,-,.,_,~,0-9,a-z,A-Z

1、   传递参数时需要使用encodeURIComponent,这样组合的url才不会被#等特殊字符截断。                           
例如:<script language="javascript">document.write('<a href="http://www.cpuele.com?aid=7&u='+encodeURIComponent(http://www.cpuele.com/index.htm)+'">退出</a>');</script>

2、   进行url跳转时可以整体使用encodeURI
例如:Location.href=encodeURI(http://www.cpuele.com/do/s?word=恒特电器&ct=21);

3、   js使用数据时可以使用escape
例如:搜藏中history纪录。

论坛徽章:
0
2 [报告]
发表于 2012-02-07 09:05 |只看该作者
本帖最后由 心如止水_00 于 2012-02-09 10:12 编辑

String.prototype.replaceAll = function(s1,s2) {
                    return this.replace(new RegExp(s1,"gm"),s2);
                }


        a.replaceAll("a","t");

论坛徽章:
0
3 [报告]
发表于 2012-03-31 11:04 |只看该作者
做个标记先

论坛徽章:
0
4 [报告]
发表于 2012-05-05 17:48 |只看该作者

论坛徽章:
0
5 [报告]
发表于 2012-05-12 08:46 |只看该作者
                       
                        ---查看锁表的情况
select     
   sess.sid,     
   sess.serial#,     
   lo.oracle_username,     
   lo.os_user_name,     
   ao.object_name,     
   lo.locked_mode   
from     
   v$locked_object lo,     
   dba_objects     ao,     
   v$session       sess     
where ao.object_id = lo.object_id     
and  lo.session_id = sess.sid;
   
---解锁
alter system kill session '1624,619';
   
   
---查看连接情况

select sid,serial#,username,program,machine,status from v$session;

论坛徽章:
0
6 [报告]
发表于 2012-05-24 10:37 |只看该作者

论坛徽章:
0
7 [报告]
发表于 2012-05-24 10:38 |只看该作者

论坛徽章:
0
8 [报告]
发表于 2012-05-25 17:14 |只看该作者
本帖最后由 心如止水_00 于 2012-05-25 17:14 编辑

http://www.cnblogs.com/java-pan/archive/2012/05/24/zipfile.html压缩 解压

论坛徽章:
0
9 [报告]
发表于 2012-05-25 17:52 |只看该作者
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP