make changes to html before append with jquery

Posted by Pradyut Bhattacharya on Stack Overflow See other posts from Stack Overflow or by Pradyut Bhattacharya
Published on 2011-02-28T15:17:52Z Indexed on 2011/02/28 15:25 UTC
Read the original article Hit count: 320

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery