Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A1 -> B1 -> B2 (the menu points back to A1)
- Time | T1 | T2 | T3
- ----------------+----------+----------+-------------
- Tab 1: | A1 -> B1 | | [refresh B1]
- Tab 2: | | A2 -> B3 |
- ----------------+----------+----------+-------------
- Menu points to: | A1 A1 | A2 A2 | A2
- // This is executed right before leaving the page
- window.onunload = function() {
- if( '{{ A }}' != null )
- var prev_A = '{{ A }}';
- else if (typeof previous_A != 'undefined') {
- var prev_A = previous_A;
- else
- var prev_A = '';
- localStorage.setItem('a', prev_A);
- };
- // Remove the local storage as soon as you get to this page
- localStorage.removeItem('a');
- var previous_A = localStorage.getItem('a');
Add Comment
Please, Sign In to add comment