Wex5循环某个div节点下的所有img标签,替换其src属性值

Model.prototype.newsDetailAfterRefresh = function(event){
    var newsDiv = this.getElementByXid("newsContent");
    var imgArr = $(newsDiv).find("img");
    $.each(imgArr,function(index,o){
        var newImgSrc = "/baas/harbinMetro/homePage"+$(o).attr("src")+"&realFileName=IMG"+justep.UUID.createUUID()+"&operateType=preview";
        $(o).attr("src",newImgSrc);
    });
};

 

posted @ 2017-05-17 13:47  如果屈原会编程  阅读(804)  评论(0编辑  收藏  举报