|
@@ -23,11 +23,22 @@ function updateUser(url)
|
|
}
|
|
}
|
|
|
|
|
|
$(function(){
|
|
$(function(){
|
|
- $("#username").keydown(function(event){
|
|
|
|
- if(event.which == 13) {
|
|
|
|
- updateUser();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ if ($("#username").length) {
|
|
|
|
+ $("#username").keydown(function(event){
|
|
|
|
+ if(event.which == 13) {
|
|
|
|
+ updateUser();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ($("#quit").length) {
|
|
|
|
+ $("#quit").click(function(event){
|
|
|
|
+ if(confirm('确定退出吗?')) {
|
|
|
|
+ var url = $(this).attr('url');
|
|
|
|
+ location.href = url;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|