本文介绍了如何通过ajax js&上传照片从个人电脑上传到脸谱墙壁/我/饲料的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嗨 关注代码与/ me / photo是否正确但是/ us / feed会出错!为什么?? 感谢您的帮助 输出: hi follow code is correct with /me/photo but get error with /me/feed !!! why?? thanks for your help Output:{ "error": { "message": "(#100) source is not properly formatted", "type": "OAuthException", "code": 100 }} 我的javascript代码: My javascript Code:function postPicToFacebookWallAjax() { var authToken = $('#hfAccessToken').val(); var files = $("#flUpload").get(0).files; var fd = new FormData(); fd.append("source", files[0]); fd.append("access_token", authToken); fd.append("caption", "caption"); fd.append("message", "Test Message"); fd.append("name", "Name"); fd.append("description", "Description field"); var url = "https://graph.facebook.com/me/feed?access_token=" + authToken; try { $.ajax({ url: url, type: "POST", data: fd, processData: false, contentType: false, cache: false, success: function(data) { alert("success " + data); }, error: function(shr, status, data) { alert("error " + data + " Status " + shr.status); }, complete: function() { alert("Posted to facebook"); } }); } catch (e) { alert(e); }} 推荐答案 这篇关于如何通过ajax js&上传照片从个人电脑上传到脸谱墙壁/我/饲料的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-23 07:48