escape用法参考如下
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script type="text/javascript">
<!--
var xmlhttp;
try{
xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
try{
xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
try{
xmlhttp= new XMLHttpRequest();
}catch(e){}
}
}
function getName()
{
var id;
id = document.getElementById("myid").value;
xmlhttp.open("get","xmlhttp.asp?id="+id);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4){
document.getElementById("myname").value =unescape(xmlhttp.responseText);
}
}
xmlhttp.setRequestHeader("If-Modified-Since","0");
xmlhttp.send(null);
}
//-->
</script>
xmlhttp.asp代码如下:
<%
Set conn=Server.CreateObject("ADODB.CONNECTION")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.Mappath("sjnews.mdb")
set rs = server.CreateObject ("adodb.recordset")
id=Request.QueryString("id")
sql="select * from news where id="&id
rs.open sql,conn,1,1
if not rs.bof then
response.Write(escape(rs("laiyuan")))
end if %>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script type="text/javascript">
<!--
var xmlhttp;
try{
xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
try{
xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
try{
xmlhttp= new XMLHttpRequest();
}catch(e){}
}
}
function getName()
{
var id;
id = document.getElementById("myid").value;
xmlhttp.open("get","xmlhttp.asp?id="+id);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4){
document.getElementById("myname").value =unescape(xmlhttp.responseText);
}
}
xmlhttp.setRequestHeader("If-Modified-Since","0");
xmlhttp.send(null);
}
//-->
</script>
xmlhttp.asp代码如下:
<%
Set conn=Server.CreateObject("ADODB.CONNECTION")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.Mappath("sjnews.mdb")
set rs = server.CreateObject ("adodb.recordset")
id=Request.QueryString("id")
sql="select * from news where id="&id
rs.open sql,conn,1,1
if not rs.bof then
response.Write(escape(rs("laiyuan")))
end if %>
解决方案 »
- 麻烦推荐一个软件啊 可以抓取网页源码的 当然也包括其链接页面的代码
- help !!!救命啊!这段代码怎么改啊,明天就该答辩了,各位大侠帮帮忙啊
- Microsoft VBScript 运行时错误 错误 '800a01a8'
- js 如何关闭窗口
- js如何输出文本块代码?
- 100分求解VML问题:使用VML画线,帮顶的有分!
- javascript的使用对象问题
- try....catch.....错误
- 一个没有解决的问题,用JavaScript正则表达式替换连接字符。
- JavaScript中的document.createElement('img')与new Image()主要有什么区别呢?
- 我要在网页的开头输出<meta http-equiv="Content-Language" content="zh-cn">
- js按钮问题
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
或加header
你这个定义的是什么编码?
response.setCharacterEncoding("utf-8");
并且在 page 中还应写上 pageEncoding="utf-8" 这样就OK了