Skip to content

Instantly share code, notes, and snippets.

@jbourassa
Created September 11, 2013 20:32
Show Gist options
  • Save jbourassa/6529382 to your computer and use it in GitHub Desktop.
Save jbourassa/6529382 to your computer and use it in GitHub Desktop.
`window.onbeforeunload` with TurboLinks support.
@allenwyma
Copy link

Hmm, wasn't able to get this to work

$('form[data-check-form]').each ->
      $this = $(this)
      form_clean = $this.serialize()
      Unloader.register -> "Not clean" if $this.serialize() != form_clean

Am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment