jQuery change contents of element
<p><strong>Possible duplicate: <a href="http://stackoverflow.com/questions/1103172/jquery-change-div-text">jquery change div text</a></strong> </p>

<p>The above question is a possible duplicate, but I don't know why it doesn't work. I'm fairly new to jQuery as well.</p>

<p>Below is part of the function (all I have written right now). It's being triggered with an <code>onclick</code> event for an anchor tag.</p>

<pre><code>function changeStatus(user)
{
    var esc = true;
    $.get('ajax/popupBase.html', user, function(data, stat, d) {
        $("#AjaxFrame").html(data);
    }, 'html');

    $.get('ajax/changeStatus.html', user, function(data, stat, d) {
        $("#PopupBody").html(data);
    }, 'html');

    $("#AjaxFrame").fadeIn('fast');
    $("#PopupTitle").html("Status Update");
    $("#Popup").center();
    popupState = 1;

    return esc;
}
</code></pre>

<p>Here is the template "popupBase.html" that I'm using with <code>$.get()</code>:</p>

<p><em>Note: "popupBase.html" is a reproducible "popup" window that I have on this site and I can just insert data into the empty divs, and re-use html where possible</em></p>

<pre><code>&lt;div id="Popup"&gt;
    &lt;form id="Popup1" method="post"&gt;
        &lt;div id="PopupTitle"&gt;&lt;/div&gt;

        &lt;div id="PopupBody"&gt;&lt;/div&gt;

        &lt;input class="button" id="Save" name="saveChanges" type="submit" value="OK" /&gt;
        &lt;input class="button" id="Cancel" name="clearChanges" type="button" value="Cancel" /&gt;
    &lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>The <code>#AjaxFrame</code> is a container just outside all html on my site (inside <code>&lt;body&gt;</code>, outside <code>#Wrapper</code>). I also have two empty containers on my template from my <code>$.get()</code> call, called <code>#PopupTitle</code> and <code>#PopupBody</code>.</p>

<p><strong>Question:</strong> Inserting the html retrieved from "changeStatus.html" into <code>#PopupBody</code> works fine, however, adding static text from <code>#PopupTitle</code> doesn't work. In <a href="http://stackoverflow.com/a/1103191">this possible duplicate</a>'s answer, I tried using <code>.text()</code> to no avail.</p>

<p><strong>EDIT:</strong> A note for future readers, I am clearing the contents of the <code>#AjaxFrame</code> after each use which <em>should</em> renew the ID usage.</p>

<p>Other things I've tried: clearing Chrome's cache (both latest and portableapp version) and checking for typos over and over.</p>

<p>I'm realllly confused about this, any help is appreciated.</p>
