后台-插件-广告管理-内容页广告位一(手机)

您现在的位置是:首页 > 开发类 > 问答问答

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

2021-07-06 20:16:39问答人已围观

简介 <P>&nbsp;var xmlhttp5;<BR>&nbsp; function getimg()<BR>&nbsp; {<BR>&nbsp;&nbsp; alter("Start");<BR>&nbsp; &nbsp; xmlhttp5 = new ActiveXObject("Micro

<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>

最佳答案:<!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

文章来源:https://q.cnblogs.com/q/2563/

Tags:网站开发 ajax框架 

很赞哦! ()

后台-插件-广告管理-内容页广告位二(手机)

相关文章

后台-插件-广告管理-内容页广告位三(手机)
后台-插件-广告管理-内容页广告位四(手机)

文章评论

留言与评论(共有 0 条评论)
   
验证码:

本栏推荐

站点信息

  • 文章统计90135篇文章
  • 浏览统计10085次浏览
  • 评论统计1个评论
  • 标签管理标签云
  • 统计数据:统计代码
  • 微信公众号:扫描二维码,关注我们