Ajax中要注意的问题
来源:
中文源码网 浏览:138 次 日期:2024-05-13 02:31:54
【下载文档: Ajax中要注意的问题.txt 】
Ajax中要注意的问题
ajax调用的返回数据会被缓存,调用静态html ,即使把html修改了,IE依有可能然用原来的数据显示。 而firefox可以正常显示新的数据。 解决办法: prototype的GET中,设置 pars = "mod=readArticle&fid='+$F('fid')+'&rand='+Math.random(); 使用java提供的方法设置http头信息,在jsp或者servlet中都可以 response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); 使用HTML标记,如下: