getdave / fetch-pjax Goto Github PK
View Code? Open in Web Editor NEW[BETA] Enables PJAX (PushState + Ajax) style navigation with the native Fetch API
License: Other
[BETA] Enables PJAX (PushState + Ajax) style navigation with the native Fetch API
License: Other
Thank you for the great library. I have started to give a try to this. It's working well and really fasts. But the problem which I found is I couldn't make a redirection anyway if server-side returns a redirection URL. Can you please give me an idea of how I can make a redirection or if I miss something please give your advice.
Hi Dave!
Thanks for your very nice library, it works like a charm! ๐
I don't know if you're still maintaining the library, nevertheless I'll try to ask.
Is there an option or callback to wait for some condition to be true, before applying the main content replace?
Although "skeleton screens" are the hottest **** right now, I'm trying to implement a loading animation. It should be visible until all of the "Pjaxed" images are loaded.
I'm using the following code to check if all the images are loaded:
[].forEach.call(images, function(img) {
img.onload = function() {
amount--;
if (amount === 0) {
// Replace the main content here
console.log("all images loaded, ready to replace the main content")
}
}
});
However, of course the library can't wait for the images to be loaded and then replace the content.
Is there maybe something like
onBeforeRenderButWaitForSomethingToBeTrue = > X
?
Could I store the main content temporarily in a DocumentFragment
before and then wait for some condition to be true and then replace the main content with the DocumentFragment
?
Or maybe I'm missing something?
Thanks again for the great library, it helped a lot!
If you press the back button everything works find but when you then press the forward button nothing happens but a title
and url
change. Also not if you use defer
on the script tag or if put the fetch.js
before the closing body
tag. Browsers: Chrome/Safari/Firefox
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.