jCarousel dynamic content loading via Ajax
<p>Im try make a slider and load data dynamically from a php file, im get image from database but i have problem now to link this image...</p>

<p>Here is my php file <strong>ajax_php.php</strong></p>

<pre><code>// Array indexes are 0-based, jCarousel positions are 1-based.
$first = max(0, intval($_GET['first']) - 1);
$last  = max($first + 1, intval($_GET['last']) - 1);
$length = $last - $first + 1;
// ---
require_once('../../includes/config.php');
error_reporting(0);
mysql_connect($conf['host'], $conf['user'], $conf['pass']);
mysql_select_db($conf['name']);
$getUser = "SELECT * FROM sitex WHERE img_i!='images/img_i.jpg' ORDER BY `sitex`.`likes` DESC LIMIT 35";
$res = mysql_query($getUser) or die();

$images = array();

while(($row =  mysql_fetch_assoc($res))) {
    $images[] = '/images/'.$row['img_i'].'';
}

$total    = count($images);
$selected = array_slice($images, $first, $length);

// ---

header('Content-Type: text/xml');

echo '&lt;data&gt;';

echo '  &lt;total&gt;' . $total . '&lt;/total&gt;';
foreach ($selected as $img) {
    echo '&lt;image&gt;' . $img . '&lt;/image&gt;';
} 
echo '&lt;/data&gt;';
</code></pre>

<p>And here is js</p>

<pre><code>function mycarousel_itemLoadCallback(carousel, state)
{
    // Check if the requested items already exist
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }

    jQuery.get(
        'ajax_php.php',
        {
            first: carousel.first,
            last: carousel.last
        },
        function(xml) {
            mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};

function mycarousel_itemAddCallback(carousel, first, last, xml)
{

     // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));

    jQuery('image', xml).each(function(i) {
        carousel.add(first + i, mycarousel_getItemHTML(jQuery(this).text()));

    });
};


function mycarousel_getItemHTML(url)

{ 
    return '&lt;img src="' + url + '" width="75" height="75" alt="" /&gt;';
};

jQuery(document).ready(function() {
    jQuery('#futuredbc').jcarousel({

  easing: 'BounceEaseOut',
         itemVisibleOutCallback: {onAfterAnimation: function(carousel, item, i, state, evt) { carousel.remove(i); }},
        itemLoadCallback: mycarousel_itemLoadCallback
    });
});
</code></pre>

<p>This method back me result like</p>

<pre><code>&lt;img width="75" height="75" alt="" src="img.jpg"&gt;
</code></pre>

<p>But i need to make a linked image like</p>

<pre><code>&lt;a href="http://site.com/548"&gt;&lt;img width="75" height="75" alt="" src="img.jpg"&gt;&lt;/a&gt;
</code></pre>

<p>So site.com/<strong>548</strong> it'a i ID and i can get it from database <code>'.$row['id'].'</code> but i dont know how to make js and link result</p>
