I am trying to upload a photo to facebook album with this javaascript code.
FB.api(\'/me/photos\', \'post\', { access_token: GetToken(),
You're not far from the right query.
first, make sure your initiating the js sdk, and requesting permissions to post.
then, your two fields are message and URL:
var data = array();
data['message'] = 'hello world';
data['url'] = 'http://google.com/moo.jpg';
FB.api('/me/photos', 'post', data, function(response){
if (!response || response.error) {
//alert('Error occurred');
} else {
//alert('Post ID: ' + response.id);
}
});