<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
<!--
var request=false;
function Text_OnChange()
{
var cell=document.createElement("td").appendChild(document.createTextNode("foo"));
var row=document.createElement("tr").appendChild(cell);
cell.setAttribute("","");
document.getElementById("myTableBody").appendChild(row);
window.alert("ok");
var spanElement=document.getElementById("mySpan");
spanElement.style.cssText="font-wight:bold;color:red";
spanElement.setAttribute("innerHTML","foo");
}
function myload()
{
try{
request=new XMLHttpRequest();
}catch(trymicrosoft){
try{
request=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(othermicrosoft){
try{
request=new ActiveXObject("Microsoft.XMLHTTP");
}catch(failed){
request=false;
}
}
if(!request)
{
alert("Error initializing XMLHttpRequest!");
}
}
}
function getInfo()
{
var url="WebForm1.aspx"
var a=document.getElementById("txta").value;
var b=document.getElementById("txtb").value;
request.open("GET",url,true);
request.onreadystatechange = updatePage;
request.send(null);
}
function updatePage() {
if (request.readyState == 4)
if (request.status == 200)
{
alert("Server is done!");
var span=document.getElementById("mySpan");
span.setAttribute("innerHTML",request.responseText);
}
else if (request.status == 404)
alert("Request URL does not exist");
else
alert("Error: status code is " + request.status);
}
//-->
</script>
</head>
<body οnlοad="myload(); return false;2006-2-26">
<table width="141" height="75" border="1" id="myTable">
<tbody id="myTableBody">
<tr><td>sdfd</td></tr>
</tbody>
</table>
<span id="mySpan"></span>
<input type="text" name="txta" id="txta" />
<input type="text" name="txtb" id="txtb" 2006-2-27/>
<input type="button" name="btn" value="click" onClick="getInfo();return false;"/>
</body>
</html>