Windows VBscript - XMLHttpRequest 返回旧内容 [英] Windows VBscript - XMLHttpRequest Returning Old Content

查看:30
本文介绍了Windows VBscript - XMLHttpRequest 返回旧内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 vbscript 文件中,我使用 Microsoft.xmlhttp 对象访问我的 Web 服务器上的 .txt 文件.我更改了文件的内容,但 vbscript 一直显示 .txt 文件的旧内容.我不知道是什么原因造成的,我用多个 vbscripts 尝试过,都出现了同样的问题,但没有产生错误.

In my vbscript file, I am using the Microsoft.xmlhttp object to access my .txt file on my web server. I have changed the file's content, but the vbscript keeps showing the old content of the .txt file. I have no idea what could be causing this and I tried it with multiple vbscripts, all with the same problem but no error generated.

非常感谢任何帮助.

将请求发送到此网址:

url & "?t=" & Now() & " " & Timer()

为了避免缓存.

推荐答案

可能是数据被缓存了,如果你的 URL 没有改变,你会得到旧的缓存数据.尝试向 AJAX 调用添加日期/时间参数:

It could be that the data is cached and if your URL doesn't change, you get the old, cached data. Try adding a date / time parameter to your AJAX call:

objReq.open("GET", "[your url]?_t=" & Replace(CStr(CDbl(Now())), ".", ""), True)

这篇关于Windows VBscript - XMLHttpRequest 返回旧内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆