add caption text using javascript and php
<p>I'm trying to add some caption text to a div position, named </p>

<pre><code>&lt;div id="slidecaption"&gt;&lt;/div&gt;
</code></pre>

<p>So in my js here is the code:</p>

<pre><code>slides                  :   [   &lt;?php 
    //query
    query_posts(array('post_type'=&gt;'slider',
                      'posts_per_page'=&gt;'20'
                      ));

    //loop
    if(have_posts()) : 
        while (have_posts()) : the_post();
            //feature image
            $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
            $title = get_the_title();

            //echo slides
            echo "{image : '".$large_image_url[0]."', title : '&lt;h1&gt;This is a header&lt;/h1&gt;', url : ''},";

        endwhile; 
    endif; 
?&gt;]
</code></pre>

<p>What i need is to display the title inside the div above..
How can i do that?
Thanks!</p>
