jsp+ajax自动刷新实例_[AJAX教程]
一、JSP文件:auto.jsp
<%@ page contentType="text/html; charset=gb2312" %>
<%
//设置输出信息的格式及字符集
response.setContentType("text/xml; charset=UTF-8");
response.setHeader("Cache-Control","no-cache");
out.println("");
for(int i=0;i<2;i++){
out.println(""+(int)(Math.random()*10)+"型笔记本");
out.println("" +(int)(Math.random()*100)+ "");
}
out.println("");
out.close();
%>
二、html文件:autoRefresh.html
cellSpacing=0 cellPadding=0 width=200 bgColor=#f5efe7 border=0>
src="images/promo_list_top.gif" width="100%"
border=0>
height=19 colspan="2">正在热卖的笔记本
型号:
销售数量:
来源:http://blog.csdn.net/javatwt