Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint5 2 #5

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
serialize
  • Loading branch information
JD-Lora committed Mar 4, 2016
commit 4bf4ab3a8ec828ac5ac4d50ff4081ae714e4c8e4
15 changes: 14 additions & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,23 @@ $(document).ready(function() {
});

});
});



$('#album-form form').on('submit', function(e) {
e.preventDefault();
var formData = $(this).serialize();
console.log('formData', formData);
$.post('/api/albums', formData, function(album) {
console.log('album after POST', album);
renderAlbum(album); //render the server's response
});
$(this).trigger("reset");
});

});




// this function takes a single album and renders it to the page
Expand Down