If I have this code:
<div class="lists">
<a href="#new_list">New list</a>
</div>
AND
$.ajax({
url: 'xxx.php',
type: 'POST',
data: {
id_user:<?php echo $id;?>
},
dataType: 'html',
success: function (data) {
$(".lists").html(data); //here
}
});
It is possible ignore the .lists>a when replace the content? What i mean is: add the new content data but also keep the original .lists>a
thanks
Take a backup of
ainsidelistsandappend/prependthem later,Use
.prependinsted of.appendif you want the links to be above the data htmlNote:
atags are always in the top/bottom of the.lists.