67,512
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<script type="text/javascript">
var xmlhttp;
function loadXMLDoc(url)
{
xmlhttp=null;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp!=null)
{
xmlhttp.onreadystatechange=state_Change;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
else
{
alert("Your browser does not support XMLHTTP.");
}
}
function state_Change()
{
if (xmlhttp.readyState==4)
{
if (xmlhttp.status==200)
{
alert("文件内容:"+xmlhttp.status);
}
else
{
alert("Problem retrieving XML data:" + xmlhttp.responseText);
}
}
}
function startz(){
alert("11111111111");
}
</script>
</head>
<body>
<h2>Using the HttpRequest Object</h2>
<button onclick="startz()">TEST</button>
<button onclick="loadXMLDoc('c:/web.xml')">TEST_XML</button>
<html>
<head>
<title>test</title>
<script type="text/javascript">
function test(){
alert("test");
}
function startS(){
alert("11111111111");
}
</script>
</head>
<body>
<body>
<input type="button" id="bt1" value="提交" onclick="startRequest();">
<input type="button" id="bt2" value="测试1" onclick="startS()">
<input type="button" id="bt3" value="测试2" onclick="test()">
</body>
</html>
start()这个方法是js内部的,你不能随便叫这个名字啊