易截截图软件、单文件、免安装、纯绿色、仅160KB

Ajax级联操作

      Web项目中总是会用到异步操作,现在的异步操作可以用各种各样的控件来实现,但实现原理还是一样的,本人更喜欢使用最原始的Ajax操作去实现异步处理,本文仅献给那些喜欢实现Ajax和项目中要用到Ajax的朋友。
      Ajax实现原理就是客户端通过javascript操作调用服务器端操作,并处理服务器返回结果,同时保证了用户操作的页面不出现刷新操作。
      下面的实现是一个实现了省市区县级联操作的实例:
所在城市:<select name="province" class="input font12" onchange="refreshList(this.options[this.selectedIndex].value,'city');">
<%
Sql = "select * from s_province t order by provcode asc"
Set Rs = Conn.execute(Sql)
Dim i,provcode,citycode,areacode
i=1
Do while not Rs.eof
provcode = Rs("provcode")
If i=1 Then
Response.write "<option value="""&Rs("provcode")&""" selected>"&Rs("provname")&"</option>"
Else
Response.write "<option value="""&Rs("provcode")&""" >"&Rs("provname")&"</option>"
End If
i = i+1
Rs.movenext
Loop
Rs.Close
Set Rs = nothing
%>
</select>

<select name="city" id="city" class="input font12" onchange="refreshList(this.options[this.selectedIndex].value,'area');">
<%
SQL = "select * from s_city t Where t.provcode='"&provcode&"'"
Set Rs = Conn.execute(Sql)
i = 1
Do while not Rs.eof
If i=1 Then citycode = Rs("citycode")
Response.write "<option value="""&Rs("citycode")&""">"&Rs("cityname")&"</option>"
i = i+1
Rs.movenext
Loop
Rs.Close
Set Rs = nothing
%>
</select>
<select name="area" id="area" class="input font12" onchange="refreshList(this.options[this.selectedIndex].value,'street');">
<%
SQL = "select * from s_area t Where t.citycode=


相关文档:

asp.net ajax 中 Sys 为定义错误解决方案

网页中出现“'sys' 未定义
”或“'Sys' is undefined”的错误。
此时我们要做的是在 web.config
中 <system.web> 一节下面添加类似
如下内容:
    <httpHandlers>
      <add
verb="GET,HEAD" path="ScriptResource.a ......

ajax回调


xml数据:
writer.write("<root>" +
   "<name>a</name>" +
   "<name>b</name>"+
   "</root>");
前台解析:
request.onreadystatechange=function(){
  if(request.readyState==4){
   var x=requ ......

AJAX表单提交方法(JSON)

AJAX表单提交方法(JSON)
1./*****JAVA**************************************************************/
JAVA类中:
 
/*****JAVA**************************************************************/
2./*****struts.xml**************************************************************/
struts.xml文件中: ......

隐藏域方式的Ajax实现


xmlHttp形式的Ajax:XmlHttp形式的Ajax IBM技术文档库
以下是利用隐藏iframe实现的ajax:
index.htm
<html>
<head>
</head>
<body>
<iframe id="testFrame" frameborder="0" style="width:0px; height:0px;">
</ifra ......

Ajax 和 XML: 五种常见 Ajax 模式

Asynchronous JavaScript + XML(Ajax)无疑是 2006 年最热门的技术术语,且有望在
2007 得到进一步发展。但是对您的应用程序来说它究竟有什么意义呢?Ajax 应用程序中哪一种常见架构模式应用最广泛呢?本文将介绍五种常见
Ajax 设计模式,可以使用它们作为工作的基础。
的确,Ajax
是 Web 2.0
热门术语,所有人都希望 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号