codedance / jquery.AreYouSure

A light-weight jQuery "dirty forms" Plugin - it monitors html forms and alerts users to unsaved changes if they attempt to close the browser or navigate away from the page. (Are you sure?)
507 stars 145 forks source link

$dirtyForms is a global variable #117

Open hunter101 opened 8 years ago

hunter101 commented 8 years ago

Looks like you're missing a var from line 159. Sorry, I would do a PR but I've gotta dash out...

iAhmod commented 8 years ago

Change the Lines

        $dirtyForms = $("form").filter('.' + settings.dirtyClass);
        if ($dirtyForms.length == 0) {

To

        var dirtyForms = $("form").filter('.' + settings.dirtyClass);
        if (dirtyForms.length == 0) {