thybag / PJAX-Standalone

A standalone implementation of Pushstate AJAX, for non-jquery webpages.
203 stars 42 forks source link

Invoke firing multiple times #40

Open rpholdaway opened 7 years ago

rpholdaway commented 7 years ago

Hi

I'm trying to load the content of a slideshow (view, https://tympanus.net/codrops/2014/06/26/draggable-dual-view-slideshow/) using the invoke command every time the slide is changed by the user.

I'm using the invoke method to call PJAX programmatically (each time the slide changes) but if the slideshow has changed twice, the completed callback of invoke will fire twice, if the slideshow is changing for a third time the completed callback 3 times, if the slideshow changes for a 4th time, the completed callback is fired 4 times and on and on.

What am I doing wrong?

rpholdaway commented 7 years ago

Apologies - was working too long without a break. Wanted to delete this issue but I don't think I can?

Invoke was adding multiple event listeners to my container just FYI.