Commit 182dc645 authored by Sebastien Robin's avatar Sebastien Robin

dummy json call to check communication with server

parent a82e614f
......@@ -78,4 +78,29 @@
}
};
})();
(function() {
function sendData(url, data, onSuccess, onError) {
$.ajax({
url: url,
type: 'POST',
data: JSON.stringify(data),
contentType: "application/json",
//crossDomain: true,
success: function(responseJSON) {
console.log("got json response",responseJSON);
},
error: function(xhr, textStatus, errorThrown) {
onError(errorThrown);
}
});
}
setTimeout(function () {
console.log("in timeout");
sendData("http://localhost:5000/someTest", {"a": "b"},
function (response) {console.log("ok", response);},
function(foo, bar, baz) {console.log("failure");})
}, 1000);
})();
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment