Home > Software design >  How to keep a non-form page from refreshing when refresh is clicked?
How to keep a non-form page from refreshing when refresh is clicked?

Time:08-11

I'm trying to figure out how to keep a webpage the same view on user refresh, as opposed to going to a homepage. Is it best to use jQuery with CSS to keep the same page? When I use jQuery with CSS, on user refresh, a glimpse of the homepage shows, just for a second but doesn't look right to me. I've tried the preventDefault method, but from what I understand, this is mostly for form inputs. Is that correct? I'm currently querying to keep the home-page hidden with CSS, if the data-view is not the homepage, but I'm not sure if this is the best way. Can someone please give me some insight with keeping a page-view the same with user refresh?

CodePudding user response:

You can display something like a loader icon while the page is loading, but you can't display the page in my opinion because it takes time the load that's why you see that.

For example, by displaying the loader icon, you can refer to this or search for other approaches.

  • Related