The a tag click and href execution order are discussed

  • 2020-03-30 03:26:43
  • OfStack

Premise: the project starts to bind the document click event, and a tag of the document subclass also binds the click time. To achieve the effect, the document event will not be triggered after the click event is triggered. In other words, event bubbling is organized and an e.toppropagation () is added to prevent event bubbling. E.p reventDefault ()) No, this is only happening now with Google, not with ff.
Reason: the href= "#" of the hyperlink fires later than click,
Solution: return false after the method;


Related articles: