aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/event/triggerunload.html
blob: a7879c77284bc0e814bf0f262fcfd699b83b8290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!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>