Stop jQuery .load response from being cached

前端 未结 14 2128
迷失自我
迷失自我 2020-11-22 03:54

I have the following code making a GET request on a URL:

$(\'#searchButton\').click(function() {
    $(\'#inquiry\').load(\'/portal/?f=searchBilling&pid=         


        
14条回答
  •  野性不改
    2020-11-22 04:42

    One way is to add a unique number to the end of the url:

    $('#inquiry').load('/portal/?f=searchBilling&pid=' + $('#query').val()+'&uid='+uniqueId());
    

    Where you write uniqueId() to return something different each time it's called.

提交回复
热议问题