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
相关问答:
目前一个项目,遇到个大问题,要搞一个电子地图,小弟从来没搞过gis方面的东西,这次硬着头皮上了。 下面是目前遇到的个问题。。。
OpenLayer怎么向后台发送ajax请求(后台是SSH框架),在申请到后台的action后,查 ......
找了一个,但搜索后不提示,好像问题,查不出来原因,谁帮着看一下
http://www.chinaz.com/Program/Asp/020Q062632010.html
End_rbody_64769658//-->
该回复于2010-04-19 08:15:36被版主删除
对我有 ......
在本地测试时可以的。
上传到服务器就出现没有权限问题。
网上搜索说不能够跨域,但是我没有跨域啊!
都是在服务器上面怎么会有跨域呢?
该怎么解决??????
代码贴出来。。
function Ajax(url,parm,fu ......
$(document).ready(function() {
function listparam(param) {
param.OperationFlag = 1;
return param;
}
var param = {
ClassNam ......