Jsp:
<%@ page language="java" contentType="text/html; charset=GB2312" import="java.sql.*,java.util.*,publicUse.*,com.web.*" errorPage=""
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<head>
<style type="text/css">
body{
background:url(../image/abc.gif);
}
</style>
<script type="text/javascript">
var xmlHttp=false;
function createXMLHttpRequest()
{
if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
else if(window.ActiveXObject)
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
if(xmlHttp==false)
alert("创建XMLHttpRequest对象失败");
}
function updateCity()
{
var province=encodeURI(encodeURI(document.all.province.value));
createXMLHttpRequest();
xmlHttp.onreadystatechange=processor;
xmlHttp.open("POST","<%=basePath%>servlet/City?province="+province);