How dangerous is e.preventDefault();, and can it be replaced by keydown/mousedown tracking?

前端 未结 7 1826
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 17:51

I\'m working on a tracking script for a fairly sophisticated CRM for tracking form actions in Google Analytics. I\'m trying to balance the desire to track form actions accuratel

7条回答
  •  野的像风
    2021-02-04 18:46

    To expand on @Malvolio's answer: Once gaq sends the event the next item in the queue will process. This means that the event HTTP request may abort on the client side, but GA will receive the request. Don't worry about blocking script execution until the response finishes. It is a fire and forget scenario.

提交回复
热议问题