Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pjax:send eventListener doesn't work #221

Open
gggg990 opened this issue Feb 28, 2020 · 0 comments
Open

pjax:send eventListener doesn't work #221

gggg990 opened this issue Feb 28, 2020 · 0 comments

Comments

@gggg990
Copy link

gggg990 commented Feb 28, 2020

Thanks for an interesting library @MoOx . I am trying to implement a white loading bar to the pjax code... I am also testing with logging the event to the console log but it only get's fired when there's a fresh restart of the whole page not just one section. Ideally I want to see it working also when changing page sections without a full reload.

This is my code:
var pjax;
var whiteloading;

document.addEventListener("DOMContentLoaded", function() {
// Init Pjax instance
pjax = new Pjax({
elements: "a", // default is "a[href], form[action]"
selectors: ["title", ".js-Pjax"],
cacheBust: false
});
});
whiteloading = $(".whiteloading");
whiteloading.show();

document.addEventListener("pjax:send", console.log("start"));
document.addEventListener("pjax:success", console.log("done"));

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

No branches or pull requests

1 participant