aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/event/onbeforeunload.html
blob: 30053967a8d3f654c065f106beeeecf951558de5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!doctype html>
<html>
	<script src="../../jquery.js"></script>
	<script>
		function report( event ) {
			var payload = {
				source: "jQuery onbeforeunload iframe test",
				event: event.type
			};
			return parent.postMessage( JSON.stringify( payload ), "*" );
		}

		jQuery( window ).on( "beforeunload", function( event ) {
			report( event );
		} ).on( "load", function( event ) {
			setTimeout( function() {
				window.location.reload();
			}, 50 );
		} );
	</script>
</html>