File: onunload.html

package info (click to toggle)
node-jquery 3.7.1%2Bdfsg%2B~3.5.33-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,948 kB
  • sloc: javascript: 38,612; php: 223; xml: 36; makefile: 14
file content (31 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (2)
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 (trac-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>