load link into slider when clicked-ajax jquery

load link into slider when clicked-ajax jquery

hi
i,m new in jquery
i have a problem with this code if any body can help me pls help :( i have 2 category in database and all 2 category have image(pic) i want load image in image slider when user clicked on any category code:

$("#test).load('test.php?name='+categoryname,function(){ $('#slider').nivoSlider({ effect:'random', animSpeed:500, pauseTime:3000, }); });

html code:

<div id="slider" class="nivoSlider"> <span id="test"></span> </div>

test.php code

echo "<img src='$return' alt='$des_return' title='$des_return'>"."<br>";

pls answer if anybody can help thanks