Initial Commit

This commit is contained in:
Glitch (axiomatic-parade) committed 2018-03-13 20:25:39 +00:00
commit a0bca7ba51
7 files changed
+259

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
// client-side js
// run by the browser each time your view template is loaded
// by default, you've got jQuery,
// add other scripts at the bottom of index.html
$(function() {
console.log('hello world :o');
$.get('/dreams', function(dreams) {
dreams.forEach(function(dream) {
$('<li></li>').text(dream).appendTo('ul#dreams');
});
});
$('form').submit(function(event) {
event.preventDefault();
var dream = $('input').val();
$.post('/dreams?' + $.param({dream: dream}), function() {
$('<li></li>').text(dream).appendTo('ul#dreams');
$('input').val('');
$('input').focus();
});
});
});