473,388 Members | 1,385 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Issue with cache with XMLHttpRequest


Hi !

I have a problem using XMLHttpRequest (AJAX impl).

I am getting the cached data all the time.
heres the code.

function loadDoc( url )
{
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.open("GET", url, true);
req.send(null);
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processReqChange;
req.open("GET", url, true);
req.send();
}
}
}
NOTE : the url I'm requesting is not under my control.

Njoy....

Jul 23 '05 #1
2 1737
VK
Randomize your link:
....
url = XMLToRead;
var d = new Date();
if (url.search) { // in case if you're requesting a server script for
file
url.search += "&" + d.getTime();
}
else {
url.search = d.getTime();
}
....
d = null;

Jul 23 '05 #2
Thank you VK.. Problem Solved.
Njoy....

VK wrote:
Randomize your link:
...
url = XMLToRead;
var d = new Date();
if (url.search) { // in case if you're requesting a server script for
file
url.search += "&" + d.getTime();
}
else {
url.search = d.getTime();
}
...
d = null;


Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sergey Surkov | last post by:
Hello Does anybody know how to make FireFox to cache data that comes via XMLHttpRequest? Here is the issue I deal with: - On the web server (apache2) I have a static xml file test.xml - When I...
2
by: warteschlange | last post by:
Martin Honnen wrote: >You can set HTTP request headers if you need to > var httpRequest = new XMLHttpRequest(); > httpRequest.open('GET', 'file.xml', true); > ...
76
by: kwilder | last post by:
This works, but it doesn't load the latest version of the xml if it was just modified without closing and reopening the browser. Here's the scenario: I have an xml doc called results.xml. It...
42
by: Greg | last post by:
Hi, I've designed a bookmark in Ajax / PHP that I will put soon on sourceforge.net. But I've got an very tricky bug. I try it on some computers with Internet Explorer/Windows, Firefox...
13
by: TLaufenberg | last post by:
I'm new to Javascript programming and I've run into a bit of a snag with making an XMLHttpRequest in the Safari browser. Actually, the request doesn't work in Firefox either but only when I use a...
1
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
2
by: wpt394 | last post by:
Hello everyone, I have a little script that seems to hang up in internet explorer every now and again. Basically, I have a php page that sets the following headers: header(...
2
by: Michael Nemtsev [MVP] | last post by:
Hello, In the current application we have several httpmodules to process pages, and we have several pages with calls directly through the XMLHttpRequest. Now the requiremens is to detect the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.