Questions tagged [page-refresh]

Questions dealing with causing or preventing the re-rendering of an HTML document by a web browser.

1048 questions
240
votes
8 answers

Refresh a page using JavaScript or HTML

How can I refresh a page using JavaScript or HTML?
Prabakaran
  • 2,435
  • 2
  • 13
  • 3
219
votes
12 answers

Check if page gets reloaded or refreshed in JavaScript

I want to check when someone tries to refresh a page. For example, when I open a page nothing happens but when I refresh the page it should display an alert.
Ahmed
  • 2,213
  • 2
  • 14
  • 9
203
votes
3 answers

JavaScript hard refresh of current page

How can I force the web browser to do a hard refresh of the page via JavaScript? Hard refresh means getting a fresh copy of the page AND refresh all the external resources (images, JavaScript, CSS, etc.).
leepowers
  • 35,484
  • 22
  • 93
  • 127
147
votes
16 answers

Force page scroll position to top at page refresh in HTML

I am building a website which I am publishing with divs. When I refresh the page after it was scrolled to position X, then the page is loaded with the scroll position as X. How can I force the page to be scrolled to the top on page refresh? What I…
Moon
  • 17,794
  • 55
  • 130
  • 193
108
votes
11 answers

How to force reloading a page when using browser back button?

I need to somehow detect that the user has pressed a browsers back button and reload the page with refresh (reloading the content and CSS) using jquery. How to detect such action via jquery? Because right now some elements are not reloaded if I use…
John Doeherskij
  • 1,479
  • 3
  • 11
  • 17
90
votes
1 answer

How to reload page the page with pagination in Angular 2?

How can I reload the current page on Angular 2? if iam in page 2 (pagination) and refresh the page it will show page 1(URL pageload) but i want i refresh the page 2 and it will appear in page 2
FABI1987
  • 909
  • 1
  • 6
  • 3
37
votes
10 answers

How do I programmatically refresh a browser

I have three computers; Server, Client and Viewer. I am in control of the server and the viewer. The user on the Client connects to the Server and is presented with a webpage. Through a php script the user uploads an image. The image is imbedded…
hpekristiansen
  • 920
  • 3
  • 14
  • 34
30
votes
5 answers

Refresh favicon in bookmarks (Firefox)

Few days ago, I've changed the favicon of my website: it works well when I open the website: My website is also in my bookmarks, but it shows the old favicon: I already had a look here, but answers did not solved my problem. The solution is…
Mistalis
  • 16,351
  • 13
  • 68
  • 91
29
votes
13 answers

How to refresh a page in a backbone application

I am using backbone to build my web app. Currently I am facing an issue whereby if I am on the home page, I am unable to refresh the same page by just clicking on the 'home' button again. I believe that this is the limitation provided by backbone…
Zhen
  • 11,973
  • 37
  • 117
  • 194
29
votes
6 answers

React | How to detect Page Refresh (F5)

I'm using React js. I need to detect page refresh. When user hits refresh icon or press F5, I need to find out the event. I tried with stackoverflow post by using javascript functions I used javascript function beforeunload still no…
Maria Jeysingh Anbu
  • 2,564
  • 2
  • 26
  • 48
28
votes
4 answers

Execute function before refresh

On my HTML page, when the user clicks / presses F5 button the page refreshes, but before it refreshes I want to execute a function or a simple alert. User can click on refresh button, press F5 or Ctrl + R. Using core JavaScript, jQuery or YUI.
Wasim Shaikh
  • 6,300
  • 18
  • 58
  • 87
25
votes
2 answers

How can I block page autorefresh in Google Chrome?

I would like to stop autorefresh page in Google Chrome, because it is a very annoying and memory consuming issue and I can't work with the developers tools. I'm trying to delete the refresh and setTimeout function from the script using Chrome's…
G M
  • 14,123
  • 7
  • 67
  • 66
24
votes
2 answers

Percentage padding behaves unexpectedly in Firefox

I'm experiencing strange behavior in Firefox (v35 v39 v52) regarding percentage padding. I cannot reproduce this issue in Chrome. I have an element with top padding set as a percentage, like this: p { padding:10% 0 0; margin:0 0 1em; …
showdev
  • 25,529
  • 35
  • 47
  • 67
22
votes
5 answers

retain angular variables after page refresh

I'm trying to figure out a way to keep my angular variables with page refresh / across controllers. My workflow is, user logs in via facebook and gets an access token users access token will be used with every request I tried two ways, 1 -…
sameera207
  • 16,117
  • 18
  • 81
  • 143
18
votes
5 answers

how to clear browser cache in reactjs

every time I make changes to my website and try to update those changes to the running website, I've to hard refresh browser. is there any way to do it by code i already try to search it but most of saying it can not be done. referance post : How to…
Sunil Choudhary
  • 189
  • 1
  • 1
  • 7
1
2 3
69 70