Advertisement
Guest User

DO

a guest
Nov 10th, 2017
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.04 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5.     <title>Test</title>
  6.     <script language='javascript' type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.16/p5.js'></script>
  7.     <script language='javascript' type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.16/addons/p5.dom.js'></script>
  8.     <script>
  9.         var test;
  10.         var url = 'http://tutaj jest adres mojej strony';
  11.         function setup() {
  12.             test = select('#test');
  13.             test.mousePressed(clicked);
  14.         }
  15.  
  16.         function draw() {
  17.         }
  18.  
  19.         function clicked() {
  20.             httpDo(url,
  21.                 {
  22.                     method: 'GET',
  23.                     headers: { COMMAND: 'ROLL_UP' }
  24.                 },
  25.                 function () {
  26.                     background(50);
  27.                 },
  28.                 function () {
  29.                     background(color(200, 0, 0));
  30.                 });
  31.         }
  32.     </script>
  33. </head>
  34.  
  35. <body>
  36.     <button id='test'>Test</button>
  37. </body>
  38.  
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement