如何实现把<input name="ww" type="text" id="ww" value=""/>输入的中文转换成 IE地址栏%ab%cd%ef这样的编码存数据库中.希望大虾们赐教 如果可以希望做下标注 这样方便我学习谢谢 还有 如果存入数据库了 像<input name="ww" type="text" id="ww" value="<%=(w.Fields.Item("wd").Value)%>" />这样正常读取成中文
解决方案 »
- JS 霓虹灯(新年快乐)
- 在触发事件里面写外部调用的函数却不能触发
- 给javascript初学者一点指引吧
- 如何把一个button用JavaScript把它变成submit?
- 求DHTML方面比较权威的书名,电子书也行
- JS如何获取DIV里面的HTML代码
- 在IE6.0中如何使用Microsoft Script Debugger工具调试javascript代码?
- css问题:能否将<p>与</p>内的内容中的链接定义样式?
- 给个验证URL和email的函数来看看,最好有正则表达验证的
- 怎样使用javascript实现IE的另存为的功能。
- javastript 隐藏与显示
- 关于javascript中函数默认参数的问题
如果要转换,可以使用Server.UrlEncode等方法
输出Server.UrlEncode(str)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>code.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
alert(encodeURIComponent("中国"));
alert(escape(escape('小叮当')));
alert("解码:" + unescape(unescape('%25u5F20')));
alert("解码:" + unescape(decodeURIComponent('%25u5F20')));
alert("解码:" + unescape(decodeURI('%25u5F20')));
alert("转码:" + encodeURIComponent('小叮当'));
alert("2转码:" + encodeURIComponent(encodeURIComponent('小叮当')));
alert("转码:" + encodeURI('小叮当'));
alert("2转码:" + encodeURI(encodeURI('小叮当')));
alert("转码2:" + escape(encodeURIComponent('小叮当')));
alert("转码2:" + escape(encodeURI('小叮当')));
alert("转码3:" + escape(escape(encodeURI('小叮当'))));
alert("转码3:" + escape(encodeURIComponent(encodeURIComponent('小叮当'))));
alert("转码3:" + escape(encodeURI(encodeURI('小叮当'))));
</script>
</head>
<body>
</body>
</html>
转换后如果传入服务器,还需要在服务器端转回来
URLencode