tags:

views:

82

answers:

1

I'm currently using the following code to insert generated content into a DIV:

$(this).next("div").load("getcontent","contentid="+id");

However, at the moment this replaces any content in the DIV by the content returned by getpost. What I would like is to insert the content at the start of the next div. Is this possible/easy with jQuery?

+2  A: 

Use prepend, e.g:

$.get('getcontent',"contentid="+id, function(html) {
    $(this).next("div").prepend(html);
});
karim79