I encountered a problem when writing code today: the onclick event is used in HTML to realize the jump of window.location = url, and the href="javascrit:;" attribute is added to the embedded element. At this time, the jump to window.location fails. Later, I checked on the Internet, and I remembered that events in JavaScript are bubbled, which may be blocked by the embedded href event.
The solution is: add a return false statement in the onclick method to force the program to jump out and not continue to execute the following statements.