Blame view

vendor/bower-asset/jquery/test/data/ajax/onunload.html 663 Bytes
b2a15e0c   Dmitryi   роли и права поль...
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
  <!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>
  </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;
  				}
  			});
  			parent.iframeCallback( ajaxStatus );
  		});
  
  		jQuery(function() {
  			setTimeout(function() {
  				document.getElementById( "navigate" ).submit();
  			}, 0 );
  		});
  	</script>
  </body>
  </html>