Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Moritz Emanuel Beber
43 lines (35 sloc) 1.318 kb
<!DOCTYPE html>
<meta charset="UTF-8">
<script type="text/javascript"
<script type="text/javascript" src="/static/js/sijax/sijax.js"></script>
<script type="text/javascript">
{{ g.sijax.get_js()|safe }}
<div id="messages" style="border: 1px solid #e0e0e0; margin-bottom: 20px; height: 100px; padding: 5px; overflow-y: scroll;"></div>
<form id="messageForm" name="messageForm">
Message: <input type="text" id="message" style="width: 400px">
<input type="submit" value="Send">
<button id="btnClear">Clear messages</button>
<script type="text/javascript">
$(function() {
$('#messageForm').bind('submit', function() {
Sijax.request('save_message', [$('#message').attr('value')],
{ data: { csrf_token: "{{ csrf_token() }}" } });
//Prevent the form from being submitted
return false;
$('#btnClear').bind('click', function() {
Sijax.request('clear_messages', [], { data: { csrf_token: "{{ csrf_token() }}" } });
return false;
Jump to Line
Something went wrong with that request. Please try again.