I want to upload photo via Facebook graph API in Javascript. I have php file in which i have all the necessary stuffs which uploads photo to users wall and album too. What i really need is that i want to call the upload script with javascript onclick
without refreshing the current page. I have a function -
function uploadPic() {
$.post("http://myURL.com/upload/index.php", { cover: "{/literal}{$p.PID}{literal}" } );
}
I was wondering how to run the actual url - http://myURL.com/upload/index.php?cover=1
which successfully uploads the photo to users wall. What i am planning to do is upload photo to users wall silently without loading the current page and when the onclick event is called, Opens a dialog box which say user that the photo was uploaded successfully to their wall. Need suggestion/ help with the JS script.
Thank you.