1e140a9007aabaa27723c9c372821cdd5639d06c
[myslice.git] / auth / static / js / logout.js
1 /* retrieve username from the button that is clicked, the one named 'logout' 
2    and that is expected to have the 'username' attribute */
3 function logout () {
4     var username=$(this).attr('username');
5     var msg="Are you sure you want to logout as " + username + " ?";
6     /* redirect to /logout, see urls.py */
7     if (confirm(msg)) window.location="/logout/";
8 }
9 /* attach this function to the logout button */
10 $(document).ready(function() { $('#logout').click(logout); })