Setting the cache in jQuery $.post() to be false?

前端 未结 4 498
难免孤独
难免孤独 2020-12-09 12:48

I have this code:

$.post(\"php/tagNotifUnsub.php\", $(\"#tagNotifUnsub\").serialize(), function(){ 
            $(\'#tagSubDiv\').load(\'tags.php #tagSubDiv\         


        
4条回答
  •  囚心锁ツ
    2020-12-09 13:03

    Partly right, Daniel A. White!

    On devices running iOS6 and Safari, POST is also cached.

    What you can do is the following:

    $.ajaxSetup({
       type: 'POST',
       headers: { "cache-control": "no-cache" }
    });
    

提交回复
热议问题