| Author |
IE not working like firefox does
|
Justin Fox
Ranch Hand
Joined: Jan 24, 2006
Posts: 802
|
|
Ok, I have two ajax functions on a webpage, one that gets data from a php page based on the selection of a date from a datepicker. Then another function that sends data to a php page on completion and submition of a form. in IE if I select a date, fill out the form the data gets inserted into the database via php fine, and then it redirects to a payment page. But if I hit the back button, and then choose that same date again, the data that my "getter" ajax function returns isn't updated. Now if I close the browser, open a new one, go to the page and choose that date then the data return is the updated/current data for that date. In FF this is not the case, it works just fine (like it should) and calls my ajax function and sends/gets data just fine. whats going on with my IE??? Thanks, Justin Fox [ June 11, 2008: Message edited by: Bear Bibeault ]
|
You down with OOP? Yeah you know me!
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Your request is cached like all GET requests should be. If you are rolling your own XmlHttpRequest code, you can add or set the headers on the request itself. Eric
|
 |
Justin Fox
Ranch Hand
Joined: Jan 24, 2006
Posts: 802
|
|
Your request is cached like all GET requests should be. If you are rolling your own XmlHttpRequest code, you can add code: -------------------------------------------------------------------------------- xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); -------------------------------------------------------------------------------- or set the headers on the request itself. Eric
where would I put this code at? after my onreadystate == 4? Or what? and for that date string, would I just use a "new Date();" and get the string value? Justin Fox
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
You would put it with the open, send area of your code and you do not have to change the date Eric
|
 |
Justin Fox
Ranch Hand
Joined: Jan 24, 2006
Posts: 802
|
|
Cool man, I really appreciate your help. I never realized that the actual requests could get cached, I thought only pages get cached in the browser. I'm going to try that tonight to see if it works, if I run into any problems I'll just post again . Justin Fox
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56221
|
|
Originally posted by Justin Fox: I never realized that the actual requests could get cached, I thought only pages get cached in the browser.
Requests don't get cached. It's their responses that get cached, and a page is just one type of response. [ June 11, 2008: Message edited by: Bear Bibeault ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: IE not working like firefox does
|
|
|