I have a <Link> to a certain page on my Next.js website. Upon clicking it, I want the webpage to hard reload after it redirects to the destination page (whether it reloads before or after the redirect is not important). I have tried using router.push as well but a hard refresh does not occur. Any help would be appreciated.
If you want to refresh the page on load use simple anchor tags,
if you want more control over reloading the page,
Refer this:
https://nextjs.org/docs/api-reference/next/router#routerreload
I have a simple react app, to get to this app, a user clicks an anchor tag from another page. This is . Let's say this page is http://localhost/index.html
It redirects fine to the react app. Let's say it's on http://localhost/react/simple_app. In this react app, I use React Router, which has a catch all if none of the route matches. It will simply render text "Page Not Found".
When I click back button to get to index.html, both Chrome and Firefox will reload simple_app, WITH the url set to http://localhost/index.html. Obviously this will make simple_app to render "Page Not Found", as the route http://localhost/index.html is not defined in its routes. Once that rendered, the browser will immediately renders the previous page. So on this action the user will see the correctly rendered previous page. Everything seems to be pretty minor so far, just a bit of a flicker when "Page Not Found" briefly rendered then it quickly re renders index.html.
What is not fine is, if I then press "Forward" page on the browser, it will NOT re-render simple_app again. It will simply shows "Page Not Found". My suspicion on this is because briefly it has rendered it prior to moving "backwards" (with the wrong URL), hence browser will load it from cache.
Tried on firefox and chrome, with reactjs. Although this behaviour can be replicated with any JS, but specifically problematic with react router.
Also tried, if I type in the url http://localhost/simple_app, if i click back, it won't do the funky reloading with the wrong URL.
Not sure if any good solution to prevent this from happening.
To help everyone who got here looking for an answer, after a bit of digging and a bit of luck, I found the issue rooted in a library (ruby gem) we used called turbolinks. https://github.com/turbolinks/turbolinks.
This gem, injects javascripts which intercepts various navigation API such as anchor tag and browser back and forward so that it can make as our native application behaves like a Single Page App (without reloads).
So if you encountered similar behaviour, you may not be using Ruby, but check if you are using library that behaves similar to Ruby's Turbolinks. Hope this helps.
I am working on a angularjs website and when I Upload my site to public server
it work fine if i open this site by Chrome but in firefox only index content show to user and route change donot add template to ng-view?
there is no error or warning in console only this:
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience
I found very silly bug in fire fox witch add a 'height:0px' to my view class and it make my ng-view invisible ....
I add 'height:auto !important;' style to it to show my content on ng-view .
Quick Video Of Issue: DropBox Share Link
Description:
I have been experiencing some weird behavior from Safari when rendering content I fetch using restangular in <ion-content> tags.
As is seen in the video, the content is pulled - as logged in the console, however it only renders in Safari when I re-adjust the screen size. On the other hand, in Chrome, this renders without an issue.
Dependencies Installed:
restangular
ui-router
Anyone have an idea of what might be causing this behavior?! Thanks
I just encountered a weird issue on angular's ng-cloak. When I cleared my IE9 browser's cache and close and open my browser again, when i accessed the page, it display empty page :( but when i tried to refresh the page it the page is now displaying.