javascript - How to prevent Window onbeforeunload event to display message dialog -
window.addeventlistener("beforeunload", function (e) { saveformdata(); (e || window.event).returnvalue = null; return null; }); function saveformdata() { whichprojecttosave=document.getelementbyid("selectprojectid").value; savejsonf(); console.log('saved');
this code using , stop message on attached picture display. or if can point me other approach how code before closing window. ?
Comments
Post a Comment