last day (15 days later) » 

1:10 PM
-2
Q: Making album and add images at same time

lovemysqlHey guys am new to javascript facebook sdk..I have been trying to make an album and add images on it at the same time..Sfter reading some documentation part i have wrote some code like function testAPI() { var album_details = { message: "I am the album desc - test 2", name: "Some Name...

 
'/me/response.id/photos' – that is just a literal value. You need to concatenate the part before and after the variable with the variable’s content to get that result.
 
@CBroe can you please help me in concatenating ??..i have tried adding + sign but i didnt get the expecting result..it would be really helpful if you post it as an answer
 
Show what you have tried. And go read up on these basics – you should be familiar with them before using such an API.
 
@Tobi dude first listen to what am saying..am trying to make an album and an image at same time ..it not related to any cover pics ..so first read the qus
 
It is... And @CBroe is totally right, you're so far off from how it could work in the code you show here, and don't read the docs that I linked several times. But still expect people to YOUR work for you, instead of learning the basics first, at least referring to the FB docs and respecting JS basic mechanisms, and then come back with valid questions.
And, @lovemysql dude, the code you show here is the same as in your yesterdays question: stackoverflow.com/questions/27315754/…
 
1:10 PM
@Tobi yeah i accept what you have said..as you told i cant make a user prompt for making a cover pic as the current api but this is a different qus ....i have done concatenating the id as @Cbore suggested ..'/me/+response.id+/photos' but the result is still same
 
Man, that's not going to work like that. You don't concatenate string like this in JS. sraji.wordpress.com/2011/01/10/… I'm out.
 
@CBroe i have tried '/me/' +response.id+ '/photos' but it still returns an empty album ..it would be really helpful if you give me the right code as the ans ..
@CBroe please help me i have concatenated as '/me/' +response.id+ '/photos' but the image isnt showing at the newly created album
 
Log the response object to console (console.log(response)), to see what it actually contains.
 
@CBroe it gives me aN object with error: Object
why is it like that ..the code am using is like FB.api('/me/' +response.id+ '/photos', 'post', image, function(response) { console.log(response); } );
 
Check the result of the API call before, the one that is supposed to create the album.
 
1:10 PM
@CBroe it gives an object with an id number
 
Well then look at the error object you got earlier (assuming you still get that in the same place). Click on it to expand it, and see what the error is.
 
1:30 PM
the error says Unknown path components: /680753702044012/photos
do you know why its like this ??
i think this is because of the wrong api code as mentioned here stackoverflow.com/questions/8286897/…
but i cant figure out the wrong line in
FB.api('/me/' +response.id+ '/photos', 'post', image, function(response) { console.log(response); } );
 
 
3 hours later…
4:33 PM
no worries i solved it
thanks c broe
the problem was other cause
 

last day (15 days later) »