Created
October 19, 2022 03:09
-
-
Save acdcjunior/10f78faf114c6426a8b103cf54e508d1 to your computer and use it in GitHub Desktop.
jquery document ready window load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script | |
type="text/javascript" | |
src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.js" | |
></script> | |
</head> | |
<body> | |
<pre id="out"></pre> | |
<script type="text/javascript">//<![CDATA[ | |
const go = (s) => out.innerHTML += '\n' + s; | |
go('out1'); | |
$(document).ready(function(){ | |
go('r1'); | |
$(window).on('load hashchange', function(event) { go('LH'); }); | |
$(window).on('load', function(event) { go('LL'); }); | |
$(window).on('hashchange', function(event) { go('HH'); }); | |
$(window).on('pageinit', function(event) { go('PI'); }); | |
go('r2'); | |
}); | |
go('out2'); | |
$(window).on('load', function(event) { go('LOUT'); }); | |
//]]></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment