mirror of
https://github.com/donl/gPanel.git
synced 2026-05-26 22:06:36 -06:00
20 lines
524 B
JavaScript
20 lines
524 B
JavaScript
jQuery('#logoutForm').on('submit', function(e){
|
|
e.preventDefault();
|
|
|
|
var check = confirm('Are you sure you want to logut?');
|
|
|
|
if(check) {
|
|
var xhr = new XMLHttpRequest();
|
|
xhr.open(jQuery(this).attr('method'), jQuery(this).attr('action'), true);
|
|
xhr.send();
|
|
|
|
xhr.onloadend = function() {
|
|
if(xhr.status == 200 || xhr.status == 204) {
|
|
window.location.href = '/';
|
|
}
|
|
else {
|
|
alert('An error has occurred. Please contact your server\'s administrator.');
|
|
}
|
|
}
|
|
}
|
|
});
|