title: Facebook/Javascript: sending a user ID var to the database
body: <p>I've got a function which returns a User ID (of a user who has logged in to the site using Facebook). </p>
  
  <pre><code>FB.getLoginStatus(function(response) {
      if (response.status === 'connected') {
          //logging the User ID here....
          console.log(response.authResponse.userID);
      }
  });
  </code></pre>
  
  <p>Later in the script I fire off an Ajax with a bunch of vars that I've received.</p>
  
  <pre><code> multiUploader.prototype._uploader = function(file,f){
      if(typeof file[f] != undefined &amp;&amp; self._validate(file[f].type) &gt; 0){
          var data = new FormData();
          var ids = file[f].name._unique();
          data.append('file',file[f]);
          data.append('index',ids);
          data.append('title', $(".giveawayNameInput").val());
  
          $(".dfiles[rel='"+ids+"']").find(".progress").show();
          $.ajax({
              type:"POST",
              url:this.config.uploadUrl,
              data:data,
              cache: false,
              contentType: false,
              processData: false,
              success:function(rponse){
  
                  console.log(rponse);
                  //Spinner can be removed here...
              }
          });
      } else
          alert("Invalid file format - "+file[f].name);
  }
  </code></pre>
  
  <p>Where I do <code>data.append()</code> I'd like to append the User ID I've received from the first function. How can this be achieved without defining<code>response.authResponse.userID</code> as a global variable?</p>