Questions dealing with causing or preventing the re-rendering of an HTML document by a web browser.
Questions tagged [page-refresh]
1164 questions
280
votes
14 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,823
- 3
- 16
- 9
263
votes
10 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
- 37,828
- 23
- 98
- 129
255
votes
8 answers
Refresh a page using JavaScript or HTML
How can I refresh a page using JavaScript or HTML?

Prabakaran
- 2,585
- 2
- 15
- 3
177
votes
17 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
- 19,518
- 56
- 138
- 200
175
votes
18 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
- 2,269
- 3
- 13
- 19
117
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
- 1,179
- 2
- 7
- 3
53
votes
7 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
- 3,164
- 3
- 34
- 55
46
votes
8 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
- 17,793
- 13
- 73
- 97
41
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
- 1,030
- 3
- 17
- 35
40
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,880
- 18
- 61
- 88
37
votes
8 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
- 479
- 1
- 4
- 7
30
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
- 12,361
- 38
- 122
- 199
27
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
- 20,759
- 10
- 81
- 84
26
votes
10 answers
How to reload a page after the OK click on the Alert Page
I need to reload the page after the OK button is clicked on the Alert box.
I am using the following code for it
alert("Successful Message");
window.location.reload();
But the window is reloaded immediately after displaying the alertbox. Please…

Nabeel Arshad
- 261
- 1
- 3
- 3
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
- 28,454
- 37
- 55
- 73