diff options
Diffstat (limited to 'test/data/onbeforeunload.html')
-rw-r--r-- | test/data/onbeforeunload.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/data/onbeforeunload.html b/test/data/onbeforeunload.html new file mode 100644 index 000000000..62c424e89 --- /dev/null +++ b/test/data/onbeforeunload.html @@ -0,0 +1,20 @@ +<!doctype html> +<html> + <script src="/dist/jquery.js"></script> + <script> + function report( event ) { + var payload = { + event: event.type + }; + return top.postMessage( JSON.stringify(payload), "*" ); + } + + jQuery( window ).on( "beforeunload", function( event ) { + report( event ); + }).on( "load", function( event ) { + setTimeout(function() { + window.location.reload(); + }, 50); + }); + </script> +</html> |