Using jQuery .prepend combined with some PHP
<p>Im using some basic jQuery and PHP to generate a list of image to use in a jQuery slideshow.</p>

<p>Here is the PHP and HTML:</p>

<pre><code>&lt;div id="coin-slider-holder"&gt;
        &lt;div id="coin-slider"&gt;

            &lt;?php
                $url = "$CFG-&gt;themewww"."/".current_theme()."/images.xml";
                $xmlstr = file_get_contents($url);
                $xml = new SimpleXMLElement($xmlstr);  
                $images = array();

                foreach ($xml-&gt;image as $image) {
                     $id = (string)$image-&gt;id;
                     $images[$id] = array(
                         'id'     =&gt; (string)$image-&gt;id,
                         'link'     =&gt; (string)$image-&gt;href,
                         'src'     =&gt; (string)$image-&gt;source,
                         'title' =&gt; (string)$image-&gt;title,
                         'alt'     =&gt; (string)$image-&gt;alt
                     );
                 }

                 ksort($images);

                 foreach ($images as $image){
                     echo "&lt;a href='".$image['src']."'&gt;&lt;img src='".$image['src']."' alt='".$image['alt']."'/&gt;";
                     echo "&lt;span&gt;".$image['title']."&lt;/span&gt;&lt;/a&gt;";
                 }
             ?&gt; 

        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>This all works, however I want to insert this HTML and PHP at a specific point in the page which I can edit. </p>

<p>Im looking at using: </p>

<pre><code>$('#site-index .sitetopic').prepend('&lt;p&gt;Insert jQuery Slider Here&lt;/p&gt;');
</code></pre>

<p>But can I use .prepend to insert the above code?</p>
