How to set cache: false in jQuery.get call

前端 未结 7 522
天涯浪人
天涯浪人 2020-11-28 04:07

jQuery.get() is a shorthand for jQuery.ajax() with a get call. But when I set cache:false in the data of the .get() call

7条回答
  •  生来不讨喜
    2020-11-28 04:43

    Set cache: false in jQuery.get call using Below Method

    use new Date().getTime(), which will avoid collisions unless you have multiple requests happening within the same millisecond.

    Or

    The following will prevent all future AJAX requests from being cached, regardless of which jQuery method you use ($.get, $.ajax, etc.)

    $.ajaxSetup({ cache: false });
    

提交回复
热议问题