| 98 | | new Ajax.Request( "/command/login", { |
|---|
| 99 | | method: "get", |
|---|
| 100 | | onSuccess: function( transport ) { |
|---|
| 101 | | if (transport.responseText.match(/authenticated/)) |
|---|
| 102 | | redirect(); |
|---|
| 103 | | }, |
|---|
| 104 | | onException: function( transport, exception ) { |
|---|
| 105 | | throw exception; |
|---|
| 106 | | } |
|---|
| 107 | | } ); |
|---|
| | 97 | var request = new XMLHttpRequest(); |
|---|
| | 98 | |
|---|
| | 99 | request.onreadystatechange = function() { |
|---|
| | 100 | if(request.readyState != 4 || request.status < 200 || request.status >= 300) |
|---|
| | 101 | return; |
|---|
| | 102 | redirect(); |
|---|
| | 103 | }; |
|---|
| | 104 | |
|---|
| | 105 | request.open("get", "/command/login", true); |
|---|
| | 106 | request.send(); |
|---|
| 119 | | new Ajax.Request( "/command/login", { |
|---|
| 120 | | method: "post", |
|---|
| 121 | | postBody: loginData, |
|---|
| 122 | | onSuccess: function( transport ) { |
|---|
| 123 | | redirect(); |
|---|
| 124 | | }, |
|---|
| 125 | | onFailure: function( transport ) { |
|---|
| 126 | | $("login").style.backgroundColor = "red"; |
|---|
| 127 | | $("login").style.borderColor = "red"; |
|---|
| 128 | | }, |
|---|
| 129 | | onException: function( transport, exception ) { |
|---|
| 130 | | throw exception; |
|---|
| | 118 | var request = new XMLHttpRequest(); |
|---|
| | 119 | |
|---|
| | 120 | request.onreadystatechange = function() { |
|---|
| | 121 | if(request.readyState != 4) |
|---|
| | 122 | return; |
|---|
| | 123 | |
|---|
| | 124 | if(request.status < 200 || request.status >= 300) { |
|---|
| | 125 | var loginElement = document.getElementById("login"); |
|---|
| | 126 | loginElement.style.backgroundColor = "red"; |
|---|
| | 127 | loginElement.style.borderColor = "red"; |
|---|
| | 128 | return; |
|---|