OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <head> | |
3 <title>Client Page</title> | |
4 <link rel="stylesheet" href="//yui.yahooapis.com/pure/0.4.2/pure-min.css"> | |
Jamie
2014/03/03 20:56:16
Is this CSS essential for the test? If not, I woul
chaitali
2014/03/04 19:33:45
Done.
| |
5 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></sc ript> | |
6 </head> | |
7 <body> | |
8 <script> | |
Jamie
2014/03/03 20:56:16
Please pull this script out into a separate .js fi
chaitali
2014/03/04 19:33:45
Done.
| |
9 // Set some global variables | |
10 var keypressSucceeded = false; | |
11 var keypressText = ""; | |
anandc
2014/03/03 21:10:03
Single-braces for strings.
http://dev.chromium.org
chaitali
2014/03/04 19:33:45
Done.
| |
12 | |
13 (function poll(){ | |
anandc
2014/03/03 21:10:03
pollForKeyPress()
Also, space before opening-brace
chaitali
2014/03/04 19:33:45
Added a TODO for myself. I would like it to poll f
| |
14 $.ajax({ | |
15 url: "/poll?test=keytest", | |
16 type: "GET", | |
17 success: function(data){ | |
18 console.log(data); | |
19 | |
20 // If keypress succeeded then | |
21 // update relevant vars and stop polling. | |
22 if (data.keypressSucceeded == true) { | |
23 keypressSucceeded = data.keypressSucceeded; | |
24 keypressText = data.keypressText; | |
25 } else { | |
26 // If keypress did not succeed we should | |
27 // continue polling. | |
28 setTimeout(poll, 3000); | |
29 } | |
30 }, | |
31 dataType: "json"}); | |
32 })(); | |
Jamie
2014/03/03 20:56:16
I don't think there's much value in using this dec
chaitali
2014/03/04 19:33:45
Done.
| |
33 </script> | |
34 </body> | |
35 </html> | |
OLD | NEW |