1 /* retrieve username from the button that is clicked, the one named 'logout'
2 and that is expected to have the 'username' attribute */
4 var username=$(this).data('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/";
9 /* attach this function to the logout button */
10 $(document).ready(function() { $('#logout').click(logout); })