亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - Why can't I preview after taking a photo with WeChat jssdk?
黃舟
黃舟 2017-05-19 10:35:02
0
1
780

When calling the WeChat interface chooseimg, in the successful callback function, according to WeChat, each ID in the local ID list of the selected photo is taken out and used as the src of the displayed image, but in fact all the IDs It has been returned, but after putting it in html, the picture cannot be displayed

wx.chooseImage({
  count: 1,
  sizeType: ['original', 'compressed'],
  sourceType: ['camera'],
  success: function (res) {
    var localId = res.localIds;
    $.each(res.localIds,function(i,n){
      $("#pic").append('<img src='+ n + '/>');
    })
}

The above is the code I wrote, but the picture cannot be found in which p of the pic

黃舟
黃舟

人生最曼妙的風(fēng)景,竟是內(nèi)心的淡定與從容!

reply all(1)
我想大聲告訴你

It has been solved. It seems to be due to the latest browser of ios. I haven’t looked at the details. You need to use a getlocalimgdata API. In order to be compatible with Android and Apple, you also check whether the converted text in base64 format is correct. That’s it (this is my first self-question and answer, if there is anything unclear or wrong, please point it out)

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