Sunday 15 July 2012

javascript - Reloading vs Refreshing page with jquery on shared host -



javascript - Reloading vs Refreshing page with jquery on shared host -

i working codeigniter , jquery. using ajax send info codeigniter function perform db operation , in order update page.

$.ajax({ type: "post", url: base_url+"update/update", data:{ : searchids, m : message }, datatype: 'json', success: function(data) { console.log(data); }, error: function(data) { console.log(data); }, complete: function() { alert("refreshing.."); window.location.href = "pan_controller/reply"; } });

after operation finish want reload page. works in locally on wamp. when deploy shared host have reload page manually, (using reload button in browser -- screenshot above). see no errors in firebug. i've tried variety of fixes have started wonder if caching issue on shared hosting server. if there improve way reload using jquery rather redirect avoid cache on shared host?

have established complete function running in cases when page doesn't reload? if think right, it's caching problem.

you can seek adding timestamp parameter end of window.location.href value create unique each time , avoid issues caching, although improve approach send right headers response, browser knows not cache page.

window.location.href = "pan_controller/reply?t=" + (new date().gettime());

javascript php jquery ajax caching

No comments:

Post a Comment