<script type="text/javascript">
//<![CDATA[
var onbeforeunload_flag = false;

function set_onbeforeunload(value) {
  onbeforeunload_flag = value;
}

function show_confirmation(evt) {
  if (onbeforeunload_flag) {
    <%
    # This sets an additional message shown to the user when
    # he intends to navigate away and cancels the request if
    # 'Cancel' is pressed by the user.
    %>
    evt.returnValue = '<%= I18n.t('uncommitted_changes_warning') %>';
  }
}

// register basic handler
window.onbeforeunload = show_confirmation;
//]]>
</script>

<script type="text/javascript">
//<![CDATA[
var onbeforeunload_flag = false;

function set_onbeforeunload(value) {
  onbeforeunload_flag = value;
}

function show_confirmation(evt) {
  if (onbeforeunload_flag) {
    <%
    # This sets an additional message shown to the user when
    # he intends to navigate away and cancels the request if
    # 'Cancel' is pressed by the user.
    %>
    evt.returnValue = "<%= I18n.t('uncommitted_changes_warning') %>";
  }
}

// register basic handler
window.onbeforeunload = show_confirmation;
//]]>
</script>

Fix Javascript error Strings between single quotes while it should be double quotes.
Fix Javascript error
Strings between single quotes while it should be double quotes.
