ex5script.js 572 B

12345678910111213141516171819202122
  1. function userCreate() {
  2. var action = "http://localhost:8080/api/users";
  3. var postData = {};
  4. postData.mail = $('#createEmail').val();
  5. postData.user = $('#createUsername').val();
  6. postData.first = $('#createFirst').val();
  7. postData.last = $('#createLast').val();
  8. $.post(action, postData, function (data) {
  9. console.log("In post cb", data)
  10. if (data.error) {
  11. $('.alert').html(data.error);
  12. $('.alert').alert();
  13. }
  14. }, 'json');
  15. }
  16. $(document).ready(function () {
  17. // $('.alert').alert('close');
  18. });