<p>This method is a shortcut for <code>.bind('resize', handler)</code> in the first variation, and <code>.trigger('resize')</code> in the second.</p>
<p>The <code>resize</code> event is sent to the <code>window</code> element when the size of the browser window changes:</p>
<pre>$(window).resize(function() {
$('#log').append('<div>Handler for .resize() called.</div>');
});
</pre>
<p>Now whenever the browser window's size is changed, the message is appended to <div id="log"> one or more times, depending on the browser.</p>
<p>Code in a <code>resize</code> handler should never rely on the number of times the handler is called. Depending on implementation, <code>resize</code> events can be sent continuously as the resizing is in progress (the typical behavior in Internet Explorer and WebKit-based browsers such as Safari and Chrome), or only once at the end of the resize operation (the typical behavior in Firefox).</p>