Guest User

Untitled

a guest
Jan 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. A1 -> B1 -> B2 (the menu points back to A1)
  2.  
  3. Time | T1 | T2 | T3
  4. ----------------+----------+----------+-------------
  5. Tab 1: | A1 -> B1 | | [refresh B1]
  6. Tab 2: | | A2 -> B3 |
  7. ----------------+----------+----------+-------------
  8. Menu points to: | A1 A1 | A2 A2 | A2
  9.  
  10. // This is executed right before leaving the page
  11. window.onunload = function() {
  12. if( '{{ A }}' != null )
  13. var prev_A = '{{ A }}';
  14. else if (typeof previous_A != 'undefined') {
  15. var prev_A = previous_A;
  16. else
  17. var prev_A = '';
  18. localStorage.setItem('a', prev_A);
  19. };
  20. // Remove the local storage as soon as you get to this page
  21. localStorage.removeItem('a');
  22.  
  23. var previous_A = localStorage.getItem('a');
Add Comment
Please, Sign In to add comment