eclipse里建立文件后,为什么这个文件不能运行啊?

xia4621012 发布于 2014/08/16 17:01
阅读 174
收藏 0
<!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=UTF-8">
<title>nihao</title>
</head>
<body>
<script language="JavaScript">
var xmlHttp;
function createXMLHttp(){
if(window.XMLHttpRequest){
   xmlHttp=new XMLHttpRequest();
}
else{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
function showMsg(){

createXMLHttp();
xmlHttp.open("POST","tent.htm");
xmlHttp.onreadystatechange=showMsgCallback;
xmlHttp.send(null);
}
function showMsgCallback(){
if(xmlHttp.readState==4){
if(xmlHttp.status==200){
var text=xmlHttp.responseText;
//doument.getElementById("msg").className="样式表名称";
document.getElementById("msg").innerHTML=text;
}
}



}
</script>
<input type="button" value="diaoyong" onclick="showMsg()">
<span id="msg"></span>
</body>

</html>

运行环境是eclipse+tomcat6.0

加载中
返回顶部
顶部