-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

2
  • 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. Commented Sep 14, 2017 at 8: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. Commented Sep 14, 2017 at 8:09

1 Answer 1

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?

Sign up to request clarification or add additional context in comments.

3 Comments

I tried this method but it didn't work..need to Reload without Cache
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.
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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.