打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
在asp中ajax异步取数据(XMLHTTP)未正常取到数据的解决方案 – AspxHtml学习分享网
  1. Dim xmlHttp
  2. set xmlHttp = server.createobject("MSXML2.ServerXMLHTTP")
  3. xmlHttp.open "GET", "http://localhost/receiver.asp", true
  4. xmlHttp.send
  5. response.contenttype = "text/html"
  6. response.write "Receiver: " & xmlHttp.responseText

以上代码,除非receiver.asp速度非常快,否则一般接收不到xmlHttp.responseText,这样可不行,得想办法,所以有了以下代码:

  1. Dim xmlHttp
  2. set xmlHttp = server.createobject("MSXML2.ServerXMLHTTP")
  3. xmlHttp.open "GET", "http://localhost/receiver.asp", true
  4. xmlHttp.send
  5. While xmlHttp.readyState <> 4
  6. xmlHttp.waitForResponse 1000
  7. Wend
  8. response.contenttype = "text/html"
  9. response.write "Receiver: " & xmlHttp.responseText

至此,最终能正常返回xmlHttp.responseText


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
漫谈Ajax在ASP.Net中的使用
XMLHTTP在服务端和客户端的差别
AJAX
原生JavaScript手写Ajax
AJAX 教程
AjaxPro 内部机制探讨
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服