Skip to content

Conversation

@jooooock
Copy link

If an a element does not have the target=_blank attribute set, then clicking the link will open the current page, causing the page to refresh, triggering the beforeunload event, and then causing the erroneous triggering of the onWindowUnload function to be executed.

This modification uses a global variable isLinkNavigation to distinguish whether the beforeunload event is caused by clicking on the a element or by closing the window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant