易截截图软件、单文件、免安装、纯绿色、仅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


相关问答:

struts2使用ajax的问题~~~ - Web 开发 / Ajax

我现在用struts2框架中需要使用ajax实现局部刷新,但是从容器里返回的值不知道怎么从struts.xml配置文件里映射到jsp页面里,以前servlet里写out.orint("xxxxx")就可以得到~,但是现在用struts就不知道怎么 ......

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

在本地测试时可以的。
上传到服务器就出现没有权限问题。
网上搜索说不能够跨域,但是我没有跨域啊!
都是在服务器上面怎么会有跨域呢?
该怎么解决??????
代码贴出来。。

function Ajax(url,parm,fu ......

初学ajax,提问 - Web 开发 / Ajax

看了一些书,也写过一些简单的例子,感觉ajax就是用特定的对象去“问”服务器信息,再用javascript把问来的信息“写”在网页上
这就有一个问题了,如果“问”回来的信息是一个很复杂的东西,那javascript里就要有非 ......

jquery 中实现 ajax - .NET技术 / ASP.NET

各位大侠,帮帮忙。本人对jquery是一窍不通。但是有个功能必须要用到。现在学为时已晚。只好画瓢了。画到这里画不下去了。大家帮帮忙;
大概是这样的。我有一个和判断用户存在一摸一样的功能。只是我有一个层。如果 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号