0

I have a page that needs to load with a key as part of the URL, but this key has to be removed from the URL once the page has been loaded.

e.g.If the initia URL is http://localhost:1337/supplier/0AB3E8EA-D441-49D2-B467-165C11597F86 , it will change to http://localhost:1337/supplier

So now my issue is that if the user reloads the page it will reload http://localhost:1337/supplier and it will get a 404.

So Im trying to find out a way to append the Key back to URL before the page reloads and then once it has been loaded I remove the key again.

I have tried to change the window.location.href on $(window).on('beforeunload', function(){}) but it doesnt work :(

Please help :) Thank you

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
Emad
  • 346
  • 1
  • 6
  • 17
  • I don't think this is possible. Could you save the key as a cookie, and recover it from there on reload? – Daniel Diekmeier Apr 14 '16 at 11:00
  • 2
    See http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page?rq=1 – rsjaffe Apr 14 '16 at 11:00
  • @RoryJaffe I dont think that's what im looking for. Thats for when you want to modify the URL without reloading the page, my issue is to modify the URL just before the user clicks on reload. – Emad Apr 14 '16 at 11:04
  • Do all the key handling on server may be using session; – itzmukeshy7 Apr 14 '16 at 11:05

0 Answers0