File: onunload.html

package info (click to toggle)
node-jquery 3.5.1%2Bdfsg%2B~3.5.5-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,712 kB
  • sloc: javascript: 34,777; php: 221; xml: 36; makefile: 15
file content (31 lines) | stat: -rw-r--r-- 699 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<title>onunload ajax requests (#14379)</title>
	<script src="../../jquery.js"></script>
	<script src="../iframeTest.js"></script>
</head>
<body>
	<form id="navigate" action="../iframe.html"></form>
	<script>
		jQuery( window ).on( "unload", function() {
			var ajaxStatus;
			jQuery.ajax({
				url: "../name.html",
				async: false,
				complete: function( xhr, status ) {
					ajaxStatus = status;
				}
			});
			startIframeTest( ajaxStatus );
		});

		jQuery(function() {
			setTimeout(function() {
				document.getElementById( "navigate" ).submit();
			}, 0 );
		});
	</script>
</body>
</html>