易截截图软件、单文件、免安装、纯绿色、仅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 post方式提交数据如何操作? - Web 开发 / Ajax

RT!
xmlHttpRequest.send("提交参数名=值&提交参数名1=值");

var date={"数据1":"数据1值","数据2":"数据2值","数据3":"数据3值" ......

Ajax无法调用问题 - Web 开发 / Ajax

代码中,如果将//alert(1) 注释打开,那么就可以调用,如果注释掉就无法调用
怀疑是导JS文件出问题了,因为写过jsp引两个JS文件没问题,
而JSP引一个JS文件,这个JS引别外的JS文件出现下面问题,上网找了半天没结 ......

ajax 没有权限问题 - Web 开发 / Ajax

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

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

AJAX 后台怎么取不到直 - .NET技术 / ASP.NET

代码如下 请高手 指点下 谢谢
ajax_http.js
-------------
function getXMLHTTP() {
  var xmlhttp;
  if (window.ActiveXObject) {
  //IE
  try {
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号