summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2013-03-10 18:07:43 +0200
committerYuval Adam <yuv.adm@gmail.com>2013-03-10 18:07:43 +0200
commit88320335f21f3fd8aee3ccc036f66db726a523ec (patch)
tree306886a2fbe5899a44e95d14c7242581f942f5bd /index.html
parentfd1efa2a0de306847cd2dd9f8b709e9f46f2ad0d (diff)
Use proper JSON for Order objects
Diffstat (limited to 'index.html')
-rw-r--r--index.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/index.html b/index.html
index ba53bb6..a72baf1 100644
--- a/index.html
+++ b/index.html
@@ -24,13 +24,16 @@
}
$('#order-submit').click(function() {
- console.log('presub');
var type = $('input:radio[name=type]:checked').val();
var price = $('#order-price').val();
var amount = $('#order-amount').val();
- var order = client_id + '|' + type + '|' + price + '|' + amount
- ws.send(order);
- console.log('postsub');
+ var order = {
+ type: type,
+ amount: amount,
+ price: price,
+ client: client_id
+ };
+ ws.send(JSON.stringify(order));
return false;
});
});