Need a quality coder? The author of this blog is now freelancing:
Freelance PHP/CakePHP Web Developer Bristol / Southwest UK

Ajax requests cached by Internet Explorer

16 May
2010

God I hate IE…. and I really don’t often hate anything….

IE tends to cache its responses to some AJAX requests, which if you ask me is very stupid for its default behaviour.

FireFox caching is disabled by default. As always much love to the Fox.

Anyway, if you’re using jQuery.ajax() remember to pass the cache: false argument otherwise you may get unexpected results.

1
2
3
4
5
6
7
8
9
10
$.ajax({
    async:true,
    cache:false,   // <-- Set this or you will feel pain!!
    type:'post',
    data: 'data[TreeRows]=' + data,
    success:function(request, xhr){
      return true;
    },
    url:'/admin/pages/save_tree_state'
  });

Comment Form

top