Some events are added repeatedly #236
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I used the plug-in for image viewing, In the plug-in, the window
resizeevent is added. When I switch several pages, I find that theresizeevent has been added repeatedly.Make a demo
After clicking to switch the page several times, the event is added repeatedly
This is because your
"pjax:success"event listener calls youreventfunction that adds a"resize"listener, meaning that every time you load a new page with Pjax, you add a new listener.You should either only call this function once, or remove any previously-added
"resize"listeners before adding a new one.