Use callback function instead of just calling it

This commit is contained in:
redfast00 2018-08-21 16:58:52 +02:00
parent 88b5763750
commit 351424b673
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C

View file

@ -2,10 +2,9 @@ $ '.send'
.click ->
$context = $ this
$.ajax
# url: "http://localhost:8080/"
url: "https://kelder.zeus.ugent.be/messages/",
contentType: "text/plain",
type: "POST"
data: $('.chatbox').val()
success: $('#chat-response').text('Success! :)')
error: $('#chat-response').text('Error !1!')
success: _ -> $('#chat-response').text('Success! :)')
error: _ -> $('#chat-response').text('Error !1!')