Ajax: Appending list-item at the top

Posted by ptamzz on Stack Overflow See other posts from Stack Overflow or by ptamzz
Published on 2011-03-12T16:04:46Z Indexed on 2011/03/12 16:10 UTC
Read the original article Hit count: 196

Filed under:
|

I'm calling a php processing file using ajax an appending the returned HTML usign the code below

$.ajax({
    type: "POST",
    url: "proc/process.php",
    data: dataString,
    cache: false,
    success: function(html){
        $("ul#lists").append(html);
        $("ul#lists li:last").fadeIn("slow");
        $("#flash").hide();
    }   
});

It appends a <li></li> item at the end of the ul#lists. I want the returned list-item <li></li> at the top of the lists instead of being appended at the last. How do I do that??

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX