Trying to inject element after .load fires
<p>I am trying to set the contents of .myShop, after it is loaded from an external xml file. So far no luck. I think my timing is correct but I also think a loaded element may not be part of the DOM?</p>

<p>Here is what happens: "index.html" loads "template_xml.js". "template_xml.js" fires a function to get some common page elements from "common.html". All works well up to here. Then "template_xml.js" loads some data from "index.xml", in which I would like to replace every occurance of MY SHOP with the shops name.</p>

<p>I think this is the trouble code:</p>

<pre><code>            $(".pagecontent").html($(this).find("pageText").text(), function(){
                $(.shop_name).text("My Great Store Name");
            });
</code></pre>

<p>But it does not set the html of .shop_name to "My Great Store Name". All help is appreciated. The website is at <a href="http://chainery.comoj.com" rel="nofollow">http://chainery.comoj.com</a></p>

<p><em><strong>EDIT</em></strong>
I will try to add relevent code without overwhelming.</p>

<p>INDEX.HTML - this is a pretty straight forward html file, like a template. It has all the html elements and loads the javascripts. Here is the piece where "pagecontent" resides</p>

<pre><code>         &lt;!-- Begin Right Column --&gt;
    &lt;div id="content"&gt;
        &lt;div class="page_navigation"&gt;&lt;/div&gt;
        &lt;div id="loading"&gt;&lt;/div&gt;
        &lt;div class="pagecontent"&gt;&lt;/div&gt; &lt;!-- USED FOR NON PRODUCT BOXES --&gt;
        &lt;ul class="content"&gt;&lt;/ul&gt; &lt;!-- USED FOR PRODUCT BOXES --&gt;
        &lt;div style="clear:both; height:10px;"&gt;&lt;!--spacer for navigation--&gt;&lt;/div&gt;
        &lt;div class="page_navigation"&gt;&lt;/div&gt;
    &lt;/div&gt;
     &lt;!-- End Right Column --&gt;
</code></pre>

<p>This loads template_xml.js- this file gets loads different elements of a "common.html" file into index.html, just a snippet of text.</p>

<p>COMMON.HTML - this page is stright html and contains elements that reside on multiple pages.</p>

<pre><code>&lt;!-- START Navigation --&gt;
    &lt;div id="menu"&gt;
        &lt;ul id="navMenu"&gt;
            &lt;li id='home'&gt;&lt;a href="#index" rel="ajax"&gt;Home&lt;/a&gt;&lt;/li&gt;
            &lt;li id='about'&gt;&lt;a href="#"&gt;About&lt;/a&gt;&lt;/li&gt;
            &lt;li id='info'&gt;
                &lt;a href="#information"&gt;Information&lt;/a&gt;
                &lt;ul&gt;
                   &lt;li&gt;&lt;a href="#metals"&gt;Metals&lt;/a&gt;&lt;/li&gt;
                   &lt;li&gt;&lt;a href="#sizing"&gt;Jewelry Sizing&lt;/a&gt;&lt;/li&gt;
                   &lt;li&gt;&lt;a href="#findings"&gt;Findings&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/li&gt;
            &lt;li id='faqs'&gt;&lt;a href="#faqs" rel="ajax"&gt;FAQs&lt;/a&gt;&lt;/li&gt;
            &lt;li id='privacy'&gt;&lt;a href="#"&gt;Privacy&lt;/a&gt;&lt;/li&gt;
            &lt;li id='contact'&gt;&lt;a href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
</code></pre>



<p>TEMPLATE _XML.JS - THIS page does the javascript, first loading common elements from common.html into index.html. Then loads an xml file to populate the remainder.</p>

<p>Here is the function that loads the xml file and puts it into index.html:</p>

<pre><code> /* Load up non-product pages */
function get_page_XML(thePage){
//hide the content 
$('.page_navigation').hide();
$('.content').hide();
$('.pagecontent').hide();
$('#loading').show();
/* unhighlight current menu tab */
$('#navMenu li[class="current_page_item"]').attr('class', '');
$.wtMeta('hTab','');

$.get("page_xml/"+thePage+".xml", function(data) {
    /* set the meta tag that identifies this xml */
    $.wtMeta('xmlFile',thePage);
    if(($(data).find(':first-child').attr('type')) == "content"){
        $(".pagecontent").html('');
        $(data).find('Page').each(function () {
            /* set the title */
            $("title").text($(this).find("pageName").text()+" jewelry");
            //document.title = $(this).find("pageName").text();
            /* if the title is photos do something */



            /* set the content */
             $(".pagecontent").html( $(this).find("pageText").text() );
             $(".shop_name").text("My Great Store Name");




            /* set correct menu tab */
             $.wtMeta('hTab',$(this).find("hMenuHighlight").text());
        });

        $(".pagecontent").show();
        hMenuTabs();
    }else{
        /* load product page */
        loadProducts(data,thePage);
    }
    $('#loading').hide();
});
}
</code></pre>

<p>Thank you for your time,
Todd</p>
