summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2014-05-28 14:11:24 +0300
committerYuval Adam <yuv.adm@gmail.com>2014-05-28 14:11:24 +0300
commit47762976ab1048b227c45fb2359c31c748b45fa1 (patch)
tree1afc0d3affe98c2429df99350602809ea4774fae /templates
parent5c27b257eea9a9c8f5a70f5ffc9c2a290626f001 (diff)
GET and POST data
Diffstat (limited to 'templates')
-rw-r--r--templates/home.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/templates/home.html b/templates/home.html
index b8f8e18..b6e76bf 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -9,6 +9,22 @@
<script src="/static/js/underscore-min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script>
+ function get_data() {
+ $.get('/data', function(res) {
+ alert(res);
+ });
+ };
+
+ function save_data(data) {
+ $.ajax({
+ type: 'POST',
+ contentType: 'application/json',
+ data: JSON.stringify(data),
+ dataType: 'json',
+ url: '/data',
+ });
+ }
+
$(document).ready(function() {
var CHANNELS = 8;
var SUB_CHANNELS = 8;