-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
28 lines (28 loc) · 766 Bytes
/
Copy pathscript.js
File metadata and controls
28 lines (28 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$(function () {
$('form').submit(function (e) {
var $form = $(this);
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize()
}).done(function (data) {
console.log(data);
}).fail(function () {
console.log('fail');
});
e.preventDefault();
});
$('#push').on('click',function (e) {
var $form = $(this);
$.ajax({
type: 'POST',
url: '/ajax/insertInGoogleDocs.php',
data: $form.serialize()
}).done(function (data) {
console.log(data);
}).fail(function () {
console.log('fail');
});
e.preventDefault();
});
});