Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I refresh a webpage without the browser asking if I want to resend again

Tags:

javascript

I got the following code to refresh my webpage. It works great if I don't submit anything with POST but if i do, i get a message from the browser when my webpage refreshes (see image below)

location.reload(true);

I'm not looking for the browser settings tweak. I'm looking for alternative code to refresh without asking. enter image description here

like image 566
code511788465541441 Avatar asked Jul 12 '11 08:07

code511788465541441


People also ask

What are the two ways to refresh a webpage?

F5 or Ctrl+R or clicking the Reload button on the location/address bar reloads the current tab. Ctrl+F5 and Shift+Ctrl+R (<strike>F5</strike>) or holding Shift and clicking the Reload button reloads and bypasses the cache. The latter can be use if the former isn't working.

How do I refresh a page in my browser?

Chrome and Windows:Hold down Ctrl and click the Reload button. Or Hold down Ctrl and press F5.

How do I refresh a page without clicking?

In virtually all browsers, pressing the F5 key will cause the current page to refresh (on some Windows computers, you may have to hold down Fn while pressing F5 ).

Why do I keep having to refresh my browser?

By default, if it's using a lot of memory, Chrome purges the contents of some background tabs from RAM to conserve system resources. When you click back onto those tabs, the browser has to reload them because they have been erased from memory.


1 Answers

This will request for a page and not a reload.

window.location = window.location;
like image 124
dpp Avatar answered Sep 20 '22 10:09

dpp