当前位置: 首页 > 网络学院 > 客户端脚本教程 > AJAX > AJAX 服务器端脚本

AJAX
AJAX 实例
AJAX浏览器
AJAX源代码
AJAX服务端
AJAX 数据库
AJAX与XML文件
AJAX XMLHttpRequest
微软的Ajax
AJAX 介绍
AJAX HTTP 请求
AJAX 服务器端脚本
AJAX Suggest 案例
AJAX ResponseXML
AJAX AppML

AJAX 服务器端脚本


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 741 ::
收藏到网摘: n/a

AJAX - The Server-Side ASP Script
AJAX - 服务器端ASP脚本程序

Now we are going to create the script that displays the current server time.
现在,我们要着手创建用于显示服务器当前时间的脚本程序。

The responseText property (explained in the previous chapter) will store the data returned from the server. Here we want to send back the current time. The code in "time.asp" looks like this:
“responseText” 属性 (在前几章里已经对该属性作了说明)将会把服务器端返回的信息储存起来。在这里,我们希望将当前时间发送回去。“time.asp” 中的代码如下所示:

<%
response.expires=-1
response.write(time)
%>

Note: The Expires property sets how long (in minutes) a page will be cached on a browser before it expires. If a user returns to the same page before it expires, the cached version is displayed. Response.Expires=-1 indicates that the page will never be cached.
注意:Expires 属性将设置一张页面在浏览器中的缓存时间(单位:分钟)。如果在该缓存到期时打开相同的页面,那么将会显示缓存所存储的信息内容。Response.Expires=-1 表示不对页面进行缓存。


Run Your AJAX Application
运行你的 AJAX 应用程序

Try the AJAX application by typing some text into the Name text box below, then click inside the Time text box:
试着在下面的Name文本框内输入信息,然后点击Time文本框,测试一下这个AJAX程序:

Name: Time:

The Time text box gets the server's time from "time.asp" file without reloading the page!
Time文本框将会显示来自于“time.asp”文件中的时间,无须重新加载页面。

评论 (1) 1 All

登陆 | 还没注册?