Disable "Changes you made may not be saved" pop-up window

In jQuery simply use :

$(window).off('beforeunload');

@Dekel helped me to get it.

The message is the beforeunload event. And I can disable it with window.onbeforeunload = null;.

JS

  $('#export-link').click(function(e) {
    window.onbeforeunload = null;
    e.preventDefault();
    var link = $(this);
    var form = link.closest('form');

    var project_id = proj_id.find(":selected").val();
    var input = $('<input>').attr('type', 'hidden').attr('name', 'project_id').val(project_id);
    form.append($(input));

    var project_type = proj_type.val();
    input = $('<input>').attr('type', 'hidden').attr('name', 'project_type').val(project_type);
    form.append($(input));

    form.submit();
  });