这个函数如何写?在线等,谢! 发了两个请求?好乱的代码。 建议把AJAX的东西封装好,。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档 </title> <script> function $(v) {return document.getElementById(v);} function loadchildren(divid){ try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");} catch(e){ try {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} catch(e){xmlHttp=false;} } if(!xmlHttp&&typeof XMLHttpRequest!='undefined'){xmlHttp=new XMLHttpRequest();} if(xmlHttp){ xmlHttp.open("GET","1.asp?id="+divid,true); xmlHttp.onreadystatechange = function callback(){ if(xmlHttp.readyState == 4) { $(divid).setAttribute("loadIf",1) switch(xmlHttp.status){ case 200: $(divid).innerHTML = xmlHttp.responseText; break; case 404: alert('页面请求失败!'); break; } } } xmlHttp.send(null); } } function a(){ loadchildren("div1") loadchildren("div2") }onload=a </script> </head> <body><div id="div1">this div--1</div><div id="div2">this div--2</div></body>IIS5-OK LS:xmlHttp.open("GET","http://127.0.0.1/debug/1.asp?id="+divid,true);-->xmlHttp.open("GET","1.asp?id="+divid,true); 急~跪求~制作一个选择题在线测试网页的代码,能够检测答案正确与否并提示考生。 ctrl键能取消么,就像取消回车键一样? 再问正则表达式。 javascript权威指南第五版中文电子版的,哪有下载的? 图片放大镜 span的问题,请大虾指教 javascrip如何传递有" \ "的参数? 数据提交后为什么接受数据的页面没反应? 你能告诉我这是为什么吗?关于var变量定义! onestab(┼─),net_lover(孟子E章)!!! 文本框自动提示功能 body的onload事件可以在js文件中调用吗?在线等
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档 </title>
<script>
function $(v) {return document.getElementById(v);} function loadchildren(divid){
try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){
try {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){xmlHttp=false;}
}
if(!xmlHttp&&typeof XMLHttpRequest!='undefined'){xmlHttp=new XMLHttpRequest();}
if(xmlHttp){
xmlHttp.open("GET","1.asp?id="+divid,true);
xmlHttp.onreadystatechange = function callback(){
if(xmlHttp.readyState == 4) {
$(divid).setAttribute("loadIf",1)
switch(xmlHttp.status){
case 200:
$(divid).innerHTML = xmlHttp.responseText;
break;
case 404:
alert('页面请求失败!');
break;
}
}
}
xmlHttp.send(null);
}
} function a(){
loadchildren("div1")
loadchildren("div2")
}onload=a
</script>
</head>
<body>
<div id="div1">this div--1</div>
<div id="div2">this div--2</div>
</body>IIS5-OK
xmlHttp.open("GET","http://127.0.0.1/debug/1.asp?id="+divid,true);
-->
xmlHttp.open("GET","1.asp?id="+divid,true);