Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var siteKey = 'isSiteOpened:' + location.host;
- if(localStorage.getItem(siteKey)) {
- $('html').remove();
- alert('Вкладка уже открыта');
- } else {
- localStorage.setItem(siteKey, true);
- $(window).unload(function() {
- localStorage.removeItem(siteKey);
- });
- }
- });
Add Comment
Please, Sign In to add comment