How do I execute a jQuery function on page load if and only if the page is accessed via a specific hyperlink?
<p>I have a simple link, like so:</p>

<pre><code>&lt;a href="page2.html"&gt;Go to Page 2&lt;/a&gt;
</code></pre>

<p>I'd like that, when clicking this Button, it would go to the page and run a jQuery function, like so:</p>

<pre><code>$("#object-selector div").hover(
    function () {
        $(this).animate({borderTopColor: '#fdcc06', borderRightColor: '#fdcc06', borderBottomColor: '#fdcc06', borderLeftColor: '#fdcc06'}, 200).children().animate({backgroundColor: '#fed944', color: '#351e00'}, 200);
    }, 
    function () {
        $(this).animate({borderTopColor: '#FFF', borderRightColor: '#FFF', borderBottomColor: '#FFF', borderLeftColor: '#FFF'}, 200).children().animate({backgroundColor: '#af081f', color: '#FFF'}, 200);
    }
);
</code></pre>

<p>But that function shouldn't execute if the Page is navigated to <em>without</em> clicking the link. Is there a way to do it?</p>
