Skip to content

Commit

Permalink
Use the beforeunload event rather than unload
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Feb 10, 2012
1 parent b7a4199 commit 4cafa16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions jquery.placeholder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! http://mths.be/placeholder v2.0.0 by @mathias */
/*! http://mths.be/placeholder v2.0.1 by @mathias */
;(function(window, document, $) {

var isInputSupported = 'placeholder' in document.createElement('input'),
Expand Down Expand Up @@ -68,7 +68,7 @@
});

// Clear placeholder values upon page reload
$(window).bind('unload.placeholder', function() {
$(window).bind('beforeunload.placeholder', function() {
$('.placeholder').each(function() {
this.value = '';
});
Expand Down
4 changes: 2 additions & 2 deletions jquery.placeholder.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4cafa16

Please sign in to comment.