خرید بک لینک

Vote count: 0

I'm trying to use the $(window).on('beforeunload', function(){}); and editor.session.getUndoManager().isClean(); in the ace editor to check if the user made changes to a document but didn't click the submit button but for some reason it doesn't work Here's the code:

editor.on('change', function(IsChanged) {
        var IsChanged = editor.session.getUndoManager().isClean();
    });
var submitting = false;

$(window).on('beforeunload', function(){
    if (submitting == false && IsChanged == true) {
            retu "You have made some changes in the editor.";
    };
});

But for whatever reason AlertUserOnUnload always retus a boolean of true.

asked 36 secs ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 11 ارديبهشت 1395 ساعت: 6:01

صفحه بندی