jhylands

FBIDret

Jun 18th, 2013
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //variable to store the PID -> FBID
  2. var FBID;
  3. //the start of a function that gets the FBID of a user and adds it to a locally stored array so profile pics can be referenced to when the game finds changes in the position on the board
  4. function FBIDret(gid,id){
  5. var xmlhttp;
  6. if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  7. xmlhttp=new XMLHttpRequest();
  8. }
  9. else{// code for IE6, IE5
  10. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  11. }
  12. xmlhttp.onreadystatechange=function(){
  13. if (xmlhttp.readyState==4 && xmlhttp.status==200){
  14. var resp = xmlhttp.responseText;
  15. FBID = resp.split(",");
  16. }
  17. }
  18. xmlhttp.open("GET","scripts/pidtoid.php?gid=" + gid + "&pid=" + id ,true);
  19. xmlhttp.send();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment