“CAUTION: provisional headers are shown” in Chrome debugger

前端 未结 30 2943
滥情空心
滥情空心 2020-11-22 11:52

I noticed a strange caution message when looking at downloaded resources using Google chrome inspector (F12):

Caution provisional headers a

30条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 12:17

    I ran into this issue with an AJAX call that would never complete. I followed wvega's advice and tip about debugging with chrome://net-internals to eventually determine another click event handler in the page, listening on a parent node, was causing the browser to navigate to the same URL (so it wasn't easily noticeable).

    The solution was to add event.stopPropagation() in a click handler on the form submit button to keep the click from bubbling up the DOM and canceling the AJAX request in progress (initiated via a submit handler on the form).

提交回复
热议问题