Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(document).ready( function(){
- var changes_to_be_saved = false;
- $('input,select,textarea').change(function(){ changes_to_be_saved = true });
- window.onbeforeunload = function() {
- if ( !changes_to_be_saved && window['CKEDITOR'] ) {
- for ( var editor in CKEDITOR.instances ) {
- if ( CKEDITOR.instances[editor].checkDirty() ) changes_to_be_saved = true;
- }
- }
- if (needToConfirm) return "You have unsaved changes that will be lost if you leave...";
- };
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement