国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - How to refresh the tags introduced by include when the page is clicked
某草草
某草草 2017-05-24 11:34:36
0
1
959

After I click submit on the settings page, I want the avatar above to change together. The header is an imported file. Can the effect of refreshing it at the same time be achieved? ? ?

Click submit below. The top avatar has changed, but the small one in the upper right corner has not changed


The header is introduced using

This is the ajax request after successful submission. What should I do?

某草草
某草草

reply all(1)
PHPzhong

The answer is yes:

Solution

$(function(){
    var smallHeadImg=$("#small-head-img");
    var bigHeadImg=....省略;
    
    在success回調(diào)函數(shù)中,后端會返回文件上傳信息的json數(shù)據(jù)到data中,這個是必須的。
    假設(shè)data中包含了后端上傳好了圖片的path路徑
    success:function(data){
        smallHeadImg.attr("src",data.update_path);
        //同理
    }
    
});

Hope it’s useful to you

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template