I am new to JQuery and actually front end stuff. So, please help me.
I have Facebook photo upload form like this
<form id ="uploadForm" method="post" enctype="multipart/form-data">
<fieldset>
       <input id="name" type="text" />
      </fieldset>
      <fieldset>
       <textarea id="photoDtls"></textarea>
      </fieldset>
      <fieldset>
       <input name ="source" type="file"  />
      </fieldset>
      <fieldset>
       <input type="image" src="images/btnSubmit.png" onclick="uploadPhoto()"/>
       <input type="image" src="images/btnCancel.png" />
      </fieldset>
</form>
I set the form action using jquery
FB.getLoginStatus(function(response) {
          if (response.status === 'connected') {
              userAccessToken = response.authResponse.accessToken;
           $('#uploadForm').attr('action','https://graph.facebook.com/photos/*page_Id*?access_token='+userAccessToken); 
        } else if (response.status === 'not_authorized') {
              alert('not autherized');
              FB.login(function(response){
                alert('Permission granted');                
              },{scope: 'email,user_birthday,publish_stream,photo_upload'});
          } else {
              alert('not logged in');
            // the user isn't logged in to Facebook.
          }
         });
I have following javascript method to submit the form. The reason I have a separate method to do the submit without doing it in the form itself is I want to get the response.
function uploadPhoto(){
    photoCaption = $('#name').val();
    photoDetails = $('photoDtls').val();
    $( "#uploadForm" ).submit(function( event ) {
          //alert( event );
    });
}
The last code sniplet is in the working progress. Photo upload happens just fine. What I want is to capture the response which has the following. For now it is displayed in the browser. I want to get this id, and save to database along with some other properties.
{
"id": "101xxxxxxxxxxx00", "post_id": "6xxxxxx9_101xxxxxxxxxxx00"}