首页 新闻 会员 周边 捐助

求助阿急啊谁帮我看看呗。。

0
悬赏园豆:10 [已解决问题] 解决于 2008-08-25 14:01
<P>&nbsp;var xmlhttp5;<BR>&nbsp; function getimg()<BR>&nbsp; {<BR>&nbsp;&nbsp; alter("Start");<BR>&nbsp; &nbsp; xmlhttp5 = new ActiveXObject("Microsoft.XMLHTTP");<BR>&nbsp; &nbsp; xmlhttp5.onreadystatechange=statechange;<BR>&nbsp; &nbsp; xmlhttp5.Open("POST","puzzle_do.jsp",true);<BR>&nbsp; &nbsp;&nbsp;&nbsp; <BR>&nbsp; &nbsp; xmlhttp5.Send();<BR>&nbsp; &nbsp; alter("");<BR>&nbsp; }<BR>&nbsp; function statechange()<BR>&nbsp; {<BR>&nbsp; &nbsp; if (xmlhttp5.readystate==4)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (xmlhttp5.status==200){</P> <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }<BR>这段代码由什么问题么,为什么总显示找不到对象阿</P>
问题补充: 我处问题的代码在前一个项目原封不动的用就好使,这新项目就不好使了。。。。
hghsdf的主页 hghsdf | 初学一级 | 园豆:165
提问于:2008-08-25 13:35
< >
分享
最佳答案
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <script type="text/javascript" src="lib/json.js"></script> <script language="javascript" type="text/javascript"> function Car(make, model, year, color) { this.make = make; this.model = model; this.year = year; this.color = color; } function getCarObject() { return new Car("Dodge", "Coronet R/T", 1968, "yellow"); } var xmlHttp; function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } function doJSON() { var car = getCarObject(); var carAsJSON = JSON.stringify(car);//{"make":"Dodge","model":"Coronet R/T","year":1968,"color":"yellow"} alert("Car object as JSON:\n " + carAsJSON); var url = "jsonServer.aspx?timeStamp=" + new Date().getTime(); createXMLHttpRequest(); xmlHttp.open("POST", url, true); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"); //is needed when post xmlHttp.send("Roboth="+carAsJSON); } function handleStateChange() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { parseResults(); } } } function parseResults() { var responseDiv = document.getElementById("serverResponse"); if(responseDiv.hasChildNodes()) { responseDiv.removeChild(responseDiv.childNodes[0]); } var responseText = document.createT
roboth | 初学一级 |园豆:28 | 2008-08-25 13:43
其他回答(1)
0
用过JS类库吗?很好用
xiaohc | 园豆:23 (初学一级) | 2008-08-25 13:53
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册