Is it safe to call jQuery's resize() function to execute my own resize handler?
<p>I am defining a resize handler that positions some elements on the screen, like this:</p>

<pre><code>$(window).resize(function() {
    // Position elements
}
</code></pre>

<p>I also want to execute this functionality when the page first loads, so I just add the following right after the above code:</p>

<pre><code>$(window).resize();
</code></pre>

<p>This works just fine. However, I'm wondering if I may trigger any side effects, harmful or not, by calling this function - I really just want to execute my own resize handler. Of course, I could do the following to make sure that I execute only my handler:</p>

<pre><code>var positionElements = function() {
    // Position elements
}
$(window).resize(positionElements);
positionElements();
</code></pre>

<p>However, I'm new to JavaScript and I want to keep my code as concise as possible - this adds some boiler plate code to the mix.</p>

<p><strong>Edit:</strong> In fact, my code can be shortened even more by using chaining. Like this:</p>

<pre><code>$(window).resize(function() {
    // Position elements
}).resize();
</code></pre>
