close
XmlHttp範例
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=big5">
<title>Untitled Document</title>
<script language="javascript">
function include(sUrl) {
var xmlhttp = false;
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", sUrl,true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
mytext.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null)
}
</script>
</head>
<body>
<input name="gettext" type="button" value="取回文字" onClick="javascript :include('http://www.site.com/debug.txt')">
<div id="mytext" name="mytext"></div>
</body>
</html>
全站熱搜
留言列表