How to stop refreshing page after ajax call?

后端 未结 5 2052
我寻月下人不归
我寻月下人不归 2020-11-30 02:37

I am unable to stop refreshing page after ajax call. I have tried by putting e.preventDefault(); and return false; as well but again my page is refreshing.

I dont k

5条回答
  •  暖寄归人
    2020-11-30 03:18

    This was happening to me earlier tonight, and I found my way to this question - This might be a long shot but I realized what my issue was and figure this might help someone in the future dealing with this.

    Are you using something like live-server locally or some other form of script that intelligently refreshes local code if new files appear in the same working folder? If so - the page is refreshing not because of your code, but because whatever ajax you called manipulated the folder you were working in resulting in the page 'updating'.

提交回复
热议问题