ajax - Stop jQuery .load response from being cached -
i have following code making request on url:
$('#searchbutton').click(function() { $('#inquiry').load('/portal/?f=searchbilling&pid=' + $('#query').val()); });
but returned result not reflected. example, made change in response spit out stack trace stack trace did not appear when clicked on search button. looked @ underlying php code controls ajax response , had correct code , visiting page directly showed correct result output returned .load old.
if close browser , reopen it works once , starts return stale information. can control jquery or need have php script output headers control caching?
you have use more complex function $.ajax()
if want control caching on per-request basis. or, if want turn off everything, put @ top of script:
$.ajaxsetup ({ // disable caching of ajax responses cache: false });
Comments
Post a Comment