Permalink
Browse files

Post new bug ajax call

  • Loading branch information...
1 parent e83964f commit eaab3f668eb43dcb8bc04b3717d6f2f2bc727553 @samcroft committed Sep 28, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 www/js/index.js
View
@@ -40,6 +40,26 @@ $(function(){
});
}
+ $('#add-bug form').submit(function(){
+ var postData = $(this).serialize();
+
+ $.ajax({
+ type: 'POST',
+ data: postData,
+ url: 'http://localhost/bapp/add-bug.php',
+ success: function(data){
+ //do your thing
+ console.log('Bug added!');
+ },
+ error: function(){
+ //do your thing
+ console.log('There was an error');
+ }
+ });
+
+ return false;
+ });
+
loadBugs();
});

0 comments on commit eaab3f6

Please sign in to comment.