Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript prompt on window close

// custom message prompt is no more supported (only IE does)
window.addEventListener("beforeunload", function(e) {
	if( someBusyFlag )
    {
  		// ask for stay
		e.preventDefault();
      	// Chrome requires this var set
      	e.returnValue = '';
    }
	else
    {
    	// grant quit
      	delete e['returnValue'];
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: react code input 
Javascript :: how to wait for the subscribe to finish before going back to caller method in angular 
Javascript :: ajax stand for 
Javascript :: how can we access the data from array object in javascript 
Javascript :: fizzbuzz in one line javascript 
Javascript :: how to remove a variable from an array javascript 
Javascript :: javascript regex get domain from url 
Javascript :: jquery check if eleme 
Javascript :: How to write a mutation observer js 
Javascript :: window viewport width 
Javascript :: mdn bind 
Javascript :: js loop array back 
Javascript :: convert number to indian rupee format in javascript 
Javascript :: recorrer array javascript 
Javascript :: javascript add nd to number 
Javascript :: react native run android common error 
Javascript :: JavaScript chop/slice/trim off last character in string 
Python :: cv2_imshow colab 
Python :: seaborn rotate x labels 
Python :: matplotlib install 
Python :: disable images selenium python 
Python :: change django admin title 
Python :: python pandas save df to xlsx file 
Python :: rename columns in python 
Python :: clear_output jupyter 
Python :: conda create environment 
Python :: NAN values count python 
Python :: python alphabet capital 
Python :: pandas rename specific column 
Python :: check python version mac 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =