62,233
社区成员




static void ThreadsDemo()
{
Thread thrd1, thrd2;
thrd1 = new Thread(new ThreadStart(第一个方法));
thrd2 = new Thread(new ThreadStart(第二个方法));
thrd1.Start();
thrd2.Start();
}
static void ThreadFunc1()//第一个函数
{}
static void ThreadFunc2()//第二个函数
{}
//....第十个函数执行完就结束。
<input id="Button1" type="button" value="不刷新" onclick="startRequest();" />
<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function startRequest()
{
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET","response.xml",true);
xmlHttp.send(null);
}
function handleStateChange()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
alert("来自服务器的响应:"+xmlHttp.responseText);
}
}
}
</script>