Skip to content

HTTPS clone URL

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>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/sijax/sijax.js"></script>
<script type="text/javascript">
{{ g.sijax.get_js()|safe }}
</script>
</head>
<body>
<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>
</form>
<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;
});
$('#message').focus();
$('#btnClear').bind('click', function() {
Sijax.request('clear_messages', [], { data: { csrf_token: "{{ csrf_token() }}" } });
return false;
});
});
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.