make changes to html before append with jquery
- by Pradyut Bhattacharya
I m calling a page using ajax and making changes to it using jquery
but the changes are not reflected after appending(append) it to a div
as the changes are done to the html but the html var remains the same.
how do i make the changes to the html var and then append to the DOM
if i use the code directly to the DOM then there will be changes in the previous elements in the DOM
the code
$.ajax({
type: "POST",
url: 'more_images.jsp',
data: ({uid:uid, aid:aid, imgid:imgid}) ,
cache: false,
success: function(html)
{
html = $.trim(html);
$(html).filter('.corner-all').corner('5px');
$(html).filter('ol.c_album > li .img_c').corner('3px');
$(html).filter("ol.c_album > li ").find('a').attr('target', '_blank');
$('#images_list').append(html);
}
});
thanks
Pradyut