Updating URL dynamically , from input field

Updating URL dynamically , from input field

I have been working on a small part of a FB Graph API project . 

basically there is this function that does something(thats a really vague discription .. i know lol .. nevermind) . 

  1.  function testAPI() {
  2.     console.log('Welcome!  Fetching your information.... ');
  3.     FB.api('/me', function(response) {
  4.       console.log('Successful login for: ' + response.name);
  5.       document.getElementById('status').innerHTML =
  6.         'Thanks for logging in, ' + response.id + '!';
  7.     });
  8.     
  9.     //dynamic updation needed . 
  10.          FB.api('/676713385757366',function(response) {
  11.          alert(JSON.stringify(response));
  12. });
now if you look at the second last line I.E 

  1. FB.api('/676713385757366',function(response)
The Unique ID is Immediately after the slash /.

Now i need that particular id to be dynamically inputted instead of it being predefined in the code . 

What do i mean by dynamically ?? well look at the code below .

  1. <form action="http://www.purplefront.net/FacebookData/getdata.php" form id="idform">
  2.   <p>
  3.     <label for="facebookid">Enter Id:</label>
  4.     <input name="facebookid" type="text" required="required" id="facebookid">
  5.   </p>
  6.   <p>&nbsp;</p>
  7.   <p>
  8.     <input type="submit" name="submit" id="submit" value="Submit">
  9.   </p>
  10. </form>

now whatever the user inputs in the input area , is what needs to be dynamically Updated after the "Slash" in the function code . 

i know for a seasoned programmer that wld be a cakewalk task , but hmmm , i am having trouble . 

let me discuss my solution ::----

Well i have all the HTML , JS , PHP code on one page , since it a farely small app . 

also , i donno if i can come up with a pure PHp solution to this , but since lately i have done a bit of coding in JS , i would prefer a JS or Jquery only solution. 

I think i will have to use a variable and the JQuery Val() function. 

I browsered and found a few helpful resources . Like : 


While i work on the solution , i taught i'd post my problem :D 

ok , will go do sm more research now . :))