mirror of
https://github.com/30hours/blah2.git
synced 2024-11-08 12:25:42 +00:00
23 lines
400 B
JavaScript
23 lines
400 B
JavaScript
|
var host = window.location.hostname;
|
||
|
|
||
|
$(document).on('keypress', function (e) {
|
||
|
if (e.which == 32) {
|
||
|
url = "/capture/toggle";
|
||
|
|
||
|
$.getJSON('http://' + host + ':3000/capture/toggle', function () { })
|
||
|
|
||
|
.done(function (data) {
|
||
|
console.log('API worked');
|
||
|
})
|
||
|
|
||
|
.fail(function () {
|
||
|
console.log('API Fail');
|
||
|
})
|
||
|
|
||
|
.always(function () {
|
||
|
|
||
|
});
|
||
|
|
||
|
}
|
||
|
});
|