Need JavaScript for Ctrl-F5 keystroke

Joined
Feb 20, 2025
Messages
2
Reaction score
0
I see from the website that F5 = 116 but not sure what Ctrl-F5 would be. I run an Opera browser and need to force the browser to load the most current server version of my webpage. Ctrl-F5 does it nicely but I need to be able to code that in the page. I also need to be able to do that from a cell phone whereas the Ctrl-F5 only works on my Windows PC. Thanks!
 
Joined
Jul 4, 2023
Messages
577
Reaction score
77
Have you tried it?
JavaScript:
location.reload(true);

button to trigger a hard refresh
HTML:
<button onclick="location.reload(true);">Force Refresh</button>

JavaScript:
function isMobile() {
    return /Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
}

if (isMobile()) {
    location.reload(true);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,260
Messages
2,571,301
Members
47,950
Latest member
Lasonya48O

Latest Threads

Top