jquery/test/data/event/triggerunload.html
Dave Methvin 93fdfa2d8c Event: Allow triggerHandler(beforeunload)
Fixes #14791
(cherry picked from commit 06adf7c95d)

Conflicts:
	src/event.js
2014-03-04 21:50:41 -05:00

19 lines
425 B
HTML

<!doctype html>
<html>
<script src="../../jquery.js"></script>
<script>
var called = false,
error = false;
window.onerror = function() { error = true; };
jQuery( window ).on( "beforeunload", function( event ) {
called = true;
return "maybe";
}).on( "load", function( event ) {
$( window ).triggerHandler( "beforeunload" );
window.parent.iframeCallback( called && !error );
});
</script>
</html>