易截截图软件、单文件、免安装、纯绿色、仅160KB

ajax基础运行不出来? - Web 开发 / Ajax

index.html:

HTML code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Using</title>

<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("post", "in.html", true);

xmlHttp.send(null);

}



function handleStateChange() {

if(xmlHttp.readyState == 4) {

if(xmlHttp.status == 200) {

document.getElementById("results").innerHTML = xmlHttp.responseText;

}


}

}

</script>

</head>

<body>

<input type="button" value="Search" onclick="startRequest();"/>

<div id="results"></div>

</body>

</html>





in.html:

HTML code



Cod


相关问答:

Ajax无刷新下载 请各位大虾们帮帮忙啊~

<script language="javascript">
  var XMLHttpReq;
  var cont=true;
//创建XMLHttpRequest对象     
    function createXMLHttpRequest ......

jquery中向ajax问题 - Web 开发 / JavaScript

我在一个html中写如下代码:
JScript code:
<html>
<head>
<script type="text/javascript" charset="utf-8"
src="script/jquery-1.3.2.min ......

ajax无法加载返回的值 - Web 开发 / Ajax

因为网站都是生成静态的内容。有些东西没办法实时更新。我就做成了AJAX列表的形式了。
现在的问题来了,看下面的网址:
http://www.net1573.com/article/art_38.html
页面有广告加载,阅读次数,还有文章评论。这 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号