Advertisement
Arckios

Untitled

Dec 6th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. function GetParticipant(){
  2. $.ajax({
  3. url: "/participants/GetParticipant",
  4. type: 'post',
  5. complete: function(data){
  6. var response = JSON.parse(data.responseText);
  7. IdPlayer1 = response.data.owner_id;
  8. IdPlayer2 = response.data.opponent_id;
  9. IdJoueurJouant = response.data.waiting_for_user_id;
  10. if(IdJoueurJouant != null){
  11. GetCurrentId();
  12. }
  13. if(response.data.game_data != null){
  14. var parsed =response.data.game_data;
  15. var temp = parsed.replace(/=>/g, ":");
  16. boardParts2 = JSON.parse(temp);
  17. if(boardParts2 != null){
  18. console.log(boardParts2);
  19. setBoardUpdated();
  20. }
  21. }else if(response.data.game_data == null){
  22. setBoard();
  23. }
  24. console.log(response);
  25. console.log(IdPlayer1);
  26. console.log(IdPlayer2);
  27. console.log(IdJoueurJouant);
  28.  
  29. }
  30. });
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement