Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html >
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>My chess engine</title>
  6.  
  7. <meta name='viewport' content='width=device-width'>
  8.  
  9. <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'>
  10. <link rel='stylesheet prefetch' href='http://www.willangles.com/projects/chessboard/css/chessboard-0.3.0.css'>
  11. <link rel="stylesheet" href="../static/css/style.css">
  12. </head>
  13. <body>
  14. <script src="http://www.willangles.com/projects/chessboard/js/chess.js"> </script>
  15. <div id="board"></div>
  16. <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
  17. <script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script>
  18. <script src='http://www.willangles.com/projects/chessboard/js/chessboard-0.3.0.js'></script>
  19. <script src="{{ url_for('static', filename='js/index.js') }}"></script>
  20. </body>
  21. </html>
  22.  
  23. function send_move_to_engine(input) {
  24. $.ajax({
  25. type: "POST",
  26. url: "/send_move",
  27. data: { move: input },
  28. success: on_success
  29. });
  30. }
  31.  
  32. function on_success(response) {
  33. game.move(response); //this is the functions which doesnt update gui sometimes
  34. console.log(response); //this response gets written to the log each time
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement