From 31895cf12c08c1c2cbc4318ed6d0027d9c987d49 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Mon, 18 May 2015 15:36:24 +0200 Subject: [PATCH] Added forgotten file --- static/js/Logger.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 static/js/Logger.js diff --git a/static/js/Logger.js b/static/js/Logger.js new file mode 100644 index 0000000..5da07ce --- /dev/null +++ b/static/js/Logger.js @@ -0,0 +1,20 @@ +var BD = {}; + +BD.Event = {}; + +BD.Event.ArrowClicked = function() {}; +BD.Event.ArrowClicked.prototype.send = function() { + var url = "http://localhost:4000/post"; + + var data = {}; + + data.user_id = this.user_id; + data.arrow_id = this.arrow_id; + + var xhr = new XMLHttpRequest(); + xhr.open("POST", url, true); + xhr.setRequestHeader("Content-type", "application/json;charset=UTF-8"); + xhr.send(JSON.stringify(data)); + +}; +