I am using following code to upload photo to facebook with ajax:
function _upCover(id, imgURL) {
$('#uploadb').hide(0);
imgURL ="myimageurl.jpg"
var postMSG= "my test";
var url='https://graph.facebook.com/me/photos?access_token='+accessToken+"&message="+postMSG;
var formData = new FormData();
formData.append('url',imgURL);
$.ajax({ type: 'POST',
url: url,
data: formData,
cache: false,
contentType: false,
processData: false,
success: function(data){
uploads(id); },
error: function(data){
failed(id); }
});
}
This works fine in Firefox but not in other browsers because it uses FormData()
function. Is there any way to do it without using FormData()
so it works in all browsers?