diff --git a/content/assets/scripts/message.coffee b/content/assets/scripts/message.coffee new file mode 100644 index 0000000..26bff32 --- /dev/null +++ b/content/assets/scripts/message.coffee @@ -0,0 +1,11 @@ +$ '.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!') diff --git a/content/cammie.erb b/content/cammie.erb index de0dfe2..a32484e 100644 --- a/content/cammie.erb +++ b/content/cammie.erb @@ -4,6 +4,7 @@ title: Cammie --- <% content_for :scripts do %> <%= asset :js, :cammie %> +<%= asset :js, :message %> <% end %>
@@ -66,4 +67,15 @@ title: Cammie +
+

+ +