发文章
发文工具
撰写
网文摘手
文档
视频
思维导图
随笔
相册
原创同步助手
其他工具
图片转文字
文件清理
AI助手
留言交流
XMLHttpRequest 在w3c标准中这样提到:
如果响应包含了为响应体指定字符编码的头部,就使用该编码。否则,假定使用 Unicode UTF-8。
前端页面sele.asp
<" CODEPAGE="936"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www./TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www./1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><script src="selectcustomer.js"></script></head>
<body>
<form>请输入项目名称:<input name="customers" onkeyup="showCustomer(this.value)" type="text" />
</form>
<p><div id="txtHint"><b>项目信息将在此处列出。</b></div></p>
</body></html>================================================================
selectcustomer.js页面
// JavaScript Documentvar xmlHttp
function showCustomer(str){ xmlHttp=GetXmlHttpObject();if (xmlHttp==null){alert ("您的浏览器不支持AJAX!");return;} var url="getcustomer.asp";url=url+"?q="+str;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("get",url,true);
xmlHttp.send(null);}
function stateChanged(){ if (xmlHttp.readyState==4){ document.getElementById("txtHint").innerHTML=xmlHttp.responseText;}}
function GetXmlHttpObject(){var xmlHttp=null;try{// Firefox, Opera 8.0+, SafarixmlHttp=new XMLHttpRequest();}catch (e){// Internet Explorertry { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }}return xmlHttp;}
=======================================================
后端getcustomer.asp页面
<!--#include file="conn/conn.asp" --><%Response.Charset="GB2312"Response.ContentType="text/html" '加入红色显示的两句就可以解决问题response.expires=-1strSQL = "select ProjName from Proj where ProjName like '%"&request.querystring("q")&"%'"Response.Write(strsql)Set RS = Server.CreateObject("ADODB.RecordSet")
RS.open strSQL,Conn,1,1 response.write("<table>")while not rs.eofresponse.write("<tr><td>")response.write("<a href=#>"&rs("ProjName")&"</a>")response.write("</td></tr>")response.write("</table>")response.write("<table>")rs.MoveNextwendresponse.write("</table>")
%>
来自: 昵称10504424 > 《工作》
0条评论
发表
请遵守用户 评论公约
ajax多表单无刷新提交
Open strSQL, connwhile not rs.eofMachId=rs("MachId")MachName=rs("MachName")MachXH=rs("MachXH")IdT...
aspx与ascx,ashx的用法总结
aspx与ascx,ashx的用法总结。做asp.net开发的对.aspx,.ascx和.ashx都不会陌生。3、.ashx.我们熟知的.aspx是要做html控件树解析的,.aspx包含的所有html实际上是一个类,所有的html都是类里面的成员,这...
ajax强制不缓存的方法
3、在ajax发送请求前加上xmlHTTP.setRequestHeader("If-Modified-Since","0");可以禁止缓存 xmlHTTP.open("get", URL, true); xmlHTTP.onreadystatechange =...
再论怎么有效利用浏览器缓存之------怎么避免浏览器缓存静态文件. --ArtWind‘...
可能是这样 <script src="common.js"></script> 修改后 v1.1版本: <script src="common.js"></script> <script src="foo.js&q...
AJAX and JSP Primer
AJAX and JSP Primer.DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.or...
c#.net下简单的Ajax例子
在asp中ajax异步取数据(XMLHTTP)未正常取到数据的解决方案 – AspxHtml学习分享网
Dim xmlHttpset xmlHttp = server.createobject("MSXML2.ServerXMLHTTP")xmlHttp.open "GET", "http://localhost/receiver.asp", truexmlHttp.sendWhile xmlHttp.readyS...
asp注册验证用户名是否重复的Ajax实例
asp注册验证用户名是否重复的Ajax实例1。// JavaScript Documentfunction createAjax() { //该函数将返回XMLHTTP对象实例var _xmlhttp;try { _xmlhttp=new ActiveXObject("Microsoft.XMLHTTP&qu...
asp遍历excel的所有表名
asp遍历excel的所有表名<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <%.response.write("Excel表信息字段:<br />------------------------<br />"...
微信扫码,在手机上查看选中内容