Javascript examples for Browser Object Model:Window localStorage
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* www . ja v a 2s. com*/ (function(){ var isPurchase2Loaded = localStorage.getItem("Purchase2"); if(isPurchase2Loaded){ document.write("Rerouting to purchase 1..."); } else{ document.write("Loading for the first Time..."); localStorage.setItem("Purchase2", true); } })() } </script> </head> <body> </body> </html>