52,797
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Title="主页" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
欢迎使用 ASP.NET!
<input id="ajax提交" type="button" value="button" onclick="startajax()" /></h2>
<p>
若要了解关于 ASP.NET 的详细信息,请访问 <a href="http://www.asp.net/cn" title="ASP.NET 网站">www.asp.net/cn</a>。
</p>
<p>
您还可以找到 <a href="http://go.microsoft.com/fwlink/?LinkID=152368"
title="MSDN ASP.NET 文档">MSDN 上有关 ASP.NET 的文档</a>。
</p>
<script type="text/javascript">
var xmlhttp;
function cretatexmlhttp() {
if (window.ActiveXObject)
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
else if (window.xmlhttpRequest)
xmlhttp = new XMLHttpRequest()
}
function startajax() {
cretatexmlhttp()
xmlhttp.onreadystatechange =abcd;
xmlhttp.open(get, "XMLFile.xml", true)
send();
}
function abcd() {
alert(" 怎么没反应啊吼叫啊")
if (xmlhttp.readystate == 4)
if (xmlhttp.status == 200)
alert(" ajax来了啊啊")
}
</script>
</asp:Content>