Chrome displays ajax response when pressing back button

后端 未结 8 2161
闹比i
闹比i 2020-12-07 22:05

I\'ve come across a problem that if I use jQuery\'s Get method to get some content, if I click back, instead of it actually going back one page in the history, it instead sh

8条回答
  •  醉话见心
    2020-12-07 22:44

    If I want to use index method of a laravel controller returns both html and json response, I add a get parameter at the end of the endpoint to pass browser caching:

    axios.get(url, {params: {ajax: 1}})
    

提交回复
热议问题