• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IE not working like firefox does

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic