-1

I need to run a keyboard shortcut on my HTML page before the page get completely loaded. How do i do this by using Jquery or Javascript.

I need to run this code mentioned below,

Refresh a webpage (no cache) -> Ctrl + F5

Gokul S
  • 41
  • 1
  • 12
  • 1
    While this is highly unlikely to be a possibility (just consider how easy it would be for a spammer/hacker to abuse), you might like to explain what problem you are trying to fix with this as there's likely to be a more suitable solution. – freedomn-m Sep 14 '17 at 08:01
  • some images on my site are not loading correctly....but when i use **Ctrl + F5** it loads correctly. is there anything else to rectify this will be highly appreciated. – Gokul S Sep 14 '17 at 08:09

1 Answers1

1

I don't really get what you are trying to do here but triggering keyboard events can't be done as explained here.

You could however refresh the page using:

location.reload();

And there are different events that you could use for example:

window.onload = function () { location.reload(); }

But this seems like an odd thing to do, could you provide more information about what you are trying to achieve here?

  • I tried this method but it didn't work..need to **Reload without Cache** – Gokul S Sep 14 '17 at 08:15
  • some images on my site are not loading correctly....but when i use Ctrl + F5 it loads correctly. is there anything else to rectify this will be highly appreciated. – Gokul S Sep 14 '17 at 08:18
  • Maybe you should try to avoid the issue instead of looking for a way to "cheat" and reload the images. Have you tried adding a timestamp to the name of your image to fix the caching issue? – Wouter Vandevelde Sep 14 '17 at 08:54