jQuery(document).ready(function($) { if (typeof alertModalPage !== 'undefined') { if (window.location.pathname.toLowerCase() !== '/' + alertModalPage.toLowerCase()) { return; } } alertModal = $('#alert-notification-once'); alertId = $(alertModal).data('alert-id'); var alerted = sessionStorage.getItem(alertId) || ''; if (alerted != 'yes') { sessionStorage.setItem(alertId,'yes'); alertModal.find('.alert-content').append('×'); alertModal.find('.close').on('click', function(evt) { alertModal.hide(); }); alertModal.show(); $(window).on('click', function(evt) { if (evt.target.id == 'alert-notification-once') { alertModal.hide(); } }); } });