File: triggerunload.html

package info (click to toggle)
jquery 3.1.1-2%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,524 kB
  • sloc: php: 122; sh: 48; xml: 36; makefile: 29
file content (19 lines) | stat: -rw-r--r-- 454 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!doctype html>
<html>
	<script src="../../jquery.js"></script>
	<script src="../iframeTest.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" );
			startIframeTest( called && !error );
		});
	</script>
</html>