{"size": 278, "ext": "js", "max_stars_repo_path": "javascript/beforeunload.js", "max_stars_repo_name": "Shetza/silverstripe-form-extras", "max_stars_repo_stars_event_min_datetime": "2015-05-21T08:46:11.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-27T01:02:49.000Z", "max_issues_repo_path": "javascript/beforeunload.js", "max_issues_repo_name": "Shetza/silverstripe-form-extras", "max_issues_repo_issues_event_min_datetime": "2016-08-09T04:26:13.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-21T12:17:54.000Z", "max_forks_repo_path": "javascript/beforeunload.js", "max_forks_repo_name": "Shetza/silverstripe-form-extras", "max_forks_repo_forks_event_min_datetime": "2015-12-04T00:33:41.000Z", "max_forks_repo_forks_event_max_datetime": "2016-02-21T08:31:33.000Z"}
{"max_stars_count": 17, "max_issues_count": 3, "max_forks_count": 2, "avg_line_length": 21.3846153846, "max_line_length": 49, "alphanum_fraction": 0.4424460432}
/**
 * Before unload message
 */
(function($) {
    $(function() {
        $(window).on('beforeunload', function() {
            return '$message';
        });
        $('form').on('submit', function() {
            $(window).off('beforeunload');
        });
    });
})(jQuery);