Now that your server is returning 304 not modified
That means that you have not modified the XML file on the server, or the page to be loaded has not been modified locally, the local cache has caused this problem
A common way to prevent caching is to add a random number to the back, or you can add a timestamp
Like when you ask.
url = "... xml?t=" + (New Date () ()). GetTime (). toString ();
The method I used in this example:
Copy Code code as follows:
var destination= "test.html"
function goto (destination) {
var ajaxobj=new ajaxrequest; Create Ajax object, class in just that file.
Ajaxobj.method= "Get"; Set the request mode to get
ajaxobj.url=destination+ "? t=" + (new Date ()). GetTime (). toString (); The URL of the response, which can be changed to some dynamic processing page, will be known with Ajax, which can be used to return different data in the page
Set the callback function to output the response content because it is a static page (this is my requirement) so everything is coming up.
Ajaxobj.callback=function (xmlobj) {
document.getElementById (' page_content '). InnerHTML = Xmlobj.responsetext; But you have to watch this sentence!
}
Ajaxobj.send (); Send Request
}