Only loading new page after AJAX calls finish #183

Closed
opened 2018-11-08 08:16:25 -05:00 by tafelnl · 2 comments
tafelnl commented 2018-11-08 08:16:25 -05:00 (Migrated from github.com)

I'm not sure whether this problem is necessarily related to this plugin, but here goes:

Let's say I have page X which executes some long running AJAX calls on load.

If I click a link on page X that takes me to page Y (with pjax), it will not start loading page Y untill the AJAX calls mentioned above on page X finish.

Does anybody know what may be causing this? Or maybe someone knows some kind of 'hack' which cancels all current AJAX calls when clicking a link (as a temporarily solution). Because it obviously causes really poor performance when someone decides to quickly switch pages.

I'm not sure whether this problem is necessarily related to this plugin, but here goes: Let's say I have page **X** which executes some long running AJAX calls on load. If I click a link on page **X** that takes me to page **Y** (with pjax), it will not start loading page **Y** untill the AJAX calls mentioned above on page **X** finish. Does anybody know what may be causing this? Or maybe someone knows some kind of 'hack' which cancels all current AJAX calls when clicking a link (as a temporarily solution). Because it obviously causes really poor performance when someone decides to quickly switch pages.
BehindTheMath commented 2018-11-11 16:22:16 -05:00 (Migrated from github.com)

Is your AJAX call synchronous or async? Can you post the code that makes the AJAX call?

Is your AJAX call synchronous or async? Can you post the code that makes the AJAX call?
tafelnl commented 2018-11-20 09:51:13 -05:00 (Migrated from github.com)

The AJAX call were/are all async. But I think it was a problem with my hosting, because it goes all well now, since I switched hosting.

Thanks anyway! :-)

The AJAX call were/are all async. But I think it was a problem with my hosting, because it goes all well now, since I switched hosting. Thanks anyway! :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#183