0

I need to redirect user to another URL after pressnig F5, but instead of it, browser asks me to post HTML form data again. How could I do this using JQuery or JS?

Anders Marzi Tornblad
  • 18,896
  • 9
  • 51
  • 66
klutch1991
  • 229
  • 2
  • 16
  • 1
    are you posting to the same page and put a die at the end..??? – Tintu C Raju Dec 01 '15 at 11:58
  • 4
    Possible duplicate of [Best way to avoid the submit due to a refresh of the page](http://stackoverflow.com/questions/5690541/best-way-to-avoid-the-submit-due-to-a-refresh-of-the-page) – Tintu C Raju Dec 01 '15 at 11:59
  • yes, i have HTML form on that page – klutch1991 Dec 01 '15 at 12:00
  • Firstly, handle the browser refresh event and then write your redirection code. Follow this link http://stackoverflow.com/questions/12418803/how-to-stop-page-loading-when-click-on-f5 – Har devgun Dec 01 '15 at 12:26

1 Answers1

0
$(document).ready(function(){
location.replace("url here")
});

On loading the page we can direct to different url by using jquery

sarath
  • 314
  • 6
  • 15