-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
37 lines (28 loc) · 723 Bytes
/
app.js
File metadata and controls
37 lines (28 loc) · 723 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
29
30
31
32
33
34
35
36
37
'use strict';
var form2object = function(form) {
var data = {};
$(form).find("input").each(function(index, element) {
var type = $(this).attr('type');
if ($(this).attr('name') && type !== 'submit' && type !== 'hidden') {
data[$(this).attr('name')] = $(this).val();
}
});
return data;
};
$(function() {
$.ajaxSetup({
xhrFields: {
withCredentials: true
}
});
});
$('#logOut').on('click', function(e) {
e.preventDefault();
sessionStorage.currentUser = "";
var logoutCallback = function(error, data){
if(error)
console.log(error);
window.location.href = 'index.html';
};
api.logout(logoutCallback);
});