ajax示例
<script type="text/javascript">
function zh()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, IE7
}
catch(e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); //old IE
}
catch(e)
{
alert("浏览器不支持此功能");
return;
}
}
var url="/GetMesPage.aspx";
xmlHttp.open("POST",url,false);
xmlHttp.send(null);
//alert(xmlHttp.responseText);
Text1.value=xmlHttp.responseText;
setTimeout(zh,2000);
}
</script>
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.Write(DateTime.Now.ToString("HH:mm:ss"));
Response.End();
}