var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
var xmlhttp=new XMLHttpRequest()
<%@ page contentType="text/html;charset=gb2312" language="java" errorPage=""%>
<html>
<head>
<script language="javascript">
var xmlhttp ;
var url = "test2.jsp";
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
} else if (window.ActiveXObject) {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
function func_test() {
if (xmlhttp) {
xmlhttp.open("GET", url,true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
document.getElementById('testdiv').innerHTML=xmlhttp.responseText;
}
}
}
xmlhttp.send(null);
}
</script>
</head>
<body bgcolor="#FFFFFF" >
<input type="button" value="button" onclick="func_test()">
<div id="testdiv">
</div>
</body>
</html>
<%@ page contentType="text/html;charset=gb2312" language="java" errorPage=""%>
<%@ page import="java.util.*"%>
<%
out.println(Calendar.getInstance().getTime());
%>