使用ajax与服务器通信的步骤:

1. 创建一个XMLHttpRequest对象

2. 创建url,data,通过xmlHttpRequest.send()

3. 服务器端接收ajxa的请求,做相应处理(操作数据库),然后返回结果(echo语句)。

4. 客户端通过xmlHttpRequest的属性responseText,responseXML取得数据,然后完成局部刷新当前页面任务。

posted on 2015-09-27 15:37  玉E  阅读(367)  评论(0编辑  收藏  举报