How to avoid automatic page reload after XMLHttpRequest call?

前端 未结 2 1347
迷失自我
迷失自我 2021-01-12 20:33

I know this is a bit paradoxal because XMLHttpRequest shouldn\'t be reloading the page, and it\'s the whole point of it.

Tried in Chrome latest version, Safari on iO

2条回答
  •  隐瞒了意图╮
    2021-01-12 21:13

    Any chance you're triggering this by submitting a form? If you don't return false in the onsubmit handler, the form will still be submitted.

提交回复
热议问题