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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -