Created
June 18, 2012 12:51
-
-
Save subak/2948239 to your computer and use it in GitHub Desktop.
エントリー作成中にブラウザの「戻る」を防ぐ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
$(function() { | |
var $action; | |
$action = $("[name^='ACMS_POST_Entry_Insert'], [name^='ACMS_POST_Entry_Update']"); | |
if (0 !== $action.size()) { | |
window.onbeforeunload = function() { | |
return "エントリーを編集中にページを離れると保存できない場合があります。よろしいですか?"; | |
}; | |
return $($action[0].form).submit(function() { | |
return window.onbeforeunload = null; | |
}); | |
} | |
}); | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment