JSFiddle - React, Tailwind, and code Playground

by Ennio Sousa Sousa

HTML

<h1>Método $(document).ready() e $(window).load()</h1>
 <hr /><hr />
 <h3 id="doc"></h3>
 
 <hr />
 <h3 id="win"></h3>
 <img src="http://www.unixstickers.com/image/cache/data/stickers/jquery/jquery.sh-600x600.png" />

JavaScript

var enter = new Date();
	
	$(document).ready(function() {
		var load = (new Date()).getTime() - enter.getTime();
		$('#doc').text('Carregado com $(document).ready() ').append(load + ' ms');
	});
	
	$(window).load(function() {
		var load2 = (new Date()).getTime() - enter.getTime();
		$('#win').text('Carregado com $(window).load() ').append(load2 + ' ms');
	});