How can I check if the user closed the the browser tab that I opened and sent to a url?
Below is my code. When the user changes the value of a select dropdown it checks to see if the browser window was opened and if so reload the url if not open a tab to the selected url.
BUT if the user changes the select value and a new tab is opened then they close it on the next select change a new tab WILL NOT OPEN.
urlmenu.onchange = function() {
if (typeof(ref) != 'undefined') {
ref.location = this.options[ this.selectedIndex ].value;
} else {
ref = window.open( this.options[ this.selectedIndex ].value, '_blank');
}
};
Let me know if you have any questions.