Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
338 views
in Technique[技术] by (71.8m points)

javascript - 从API响应中清除我的模板设置为#comments-list的所有数据(Haw to clear all data that my template set to #comments-list from API response)

var showResults = function (title, overview,picture,pictureBack) {
    var $template = $('#comment-template').html();
    $template = $($template);

    $template.find('h4').text(title);
    $template.find('p').text(overview);
    $template.find('#pic').append(picture);
    $template.find('#picBack').append(pictureBack);

    var $commentsList = $("#comments-list");
    $commentsList.append($template);
}

I want to reset the template by clicking the button which make research

(我想通过单击进行研究的按钮来重置模板)

  ask by S.Iliev translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...