jquery - How to include check -


i have function checks particular event , when detects displays overlay message. until happens need have beforeunload in place warn user potential data loss in case decide leave page before task complete. added in following manner, when task complete , beforeunload should not fire still gets triggered. think due bind. there way can implemented achieve trying accomplish?

if (!$("#area").find('.item').length) {      $("#message").dialog({         modal: true     });  } else {     $(window).bind("beforeunload", function() {         return "are sure?";     });  }  

you need call unbind("beforeunload") remove handler.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -