问题
Why exactly does the page refresh when data is sent from a form element to the server? For data that is sent by POST for example, does what the server receives depend on how it was sent? i.e. by simple form submit, DOM submit, ajax submit, etc. Is it the server response that triggers the refresh? Is there any way to change the response that is sent so that it doesn't trigger a refresh? Or prevent a response from being sent at all? P.S. I am aware that there are a gazillion different ways that purport to send form data without a page refresh. What I am looking for is some understanding of what is going on by answers to the simple questions I have asked.
来源:https://stackoverflow.com/questions/57956498/what-is-the-mechanism-that-causes-the-page-to-refresh-when-data-is-submitted-to