Ajax实时获取信息
Ajax的IE缓存问题,会造成用open时用get方法不能重复提交,导致获取不到实时的信息。解决的办法有以下几种:
1.客户端在url后添加随机数.
new Date().getTime()或者Math.Random()
或者送请求前加上
XMLHttpRequest.setRequestHeader("If-Modified-Since","0")
2.或者用post方法提交
3.服务器端禁用缓存.
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
相关文档:
此方法用jsp内置对象out输出到xml文件中
public void ajaxEditorList() throws IOException{
HttpServletResponse response = ServletActionContext.getResponse();
//System.out.println("ddddddddddddddddddddddd;;;");
int unitid=Integer.parseInt(request.getParameter("unit ......
1.XMLHttpRequest对象
open("method","URL""[,asyncFlag[,"userName"[, "password"]]])
建立对服务器的访问。其中method参数可以使用GET、POST及PUT,URL参数既可以使用绝对地址,也可以使用相对地址,此外还包括与建立连接相关的三个参数
&nbs ......
Google Search API
参考书籍:Google API大全—编程?开发?实例
书籍对几十种Google常用API进行了梳理和介绍,辅以行之有效的代码实例
http://code.google.com/intl/zh-CN/apis/ajaxsearch/documentation/
1)Google Site Search
Google站点内嵌搜索的使用方法
<%@ page language="java" contentType="text/ht ......