How do get a parent node without having a starting reference point?
<p>I want to provide a method for my web app that allows a user to call my function anywhere within his code (inside script tags) that will display a fade-in/fade-out message. What I don't know how to do is determine where I am at in the DOM without having a starting reference point.</p>

<p>Function:</p>

<pre><code>function displayMessage(message) {
    // Display a notification if the submission is successful.
    $('&lt;div class="save-alert"&gt;' + message + '&lt;/div&gt;')
        .insertAfter($('')) // Do not know how to know where to put the message.
        .fadeIn('slow')
        .animate({ opacity: 1.0 }, 2000)
        .fadeOut('slow', function () {
        $(this).remove();
    });
}
</code></pre>

<p>The HTML:</p>

<pre><code>&lt;!-- Some HTML --&gt;
&lt;div&gt;
    &lt;script type="text/javascript"&gt;
        displayMessage("My message.");
    &lt;/script&gt;
&lt;/div&gt;
&lt;!-- Some more HTML. --&gt;
</code></pre>
