diff options
-rw-r--r-- | index.html | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -10,9 +10,20 @@ alert("username: " + data.username + "\ntoken: " + data.token ); } + function authError(req, status, error) { + alert(status + ": '" + error + "'") + } + function auth() { - $.get("/authtoken.json", authSuccess, "json"); + $.ajax("/authtoken.json", + { cache: false, + username: $("#username").val(), + password: $("#password").val(), + dataType: "json", + error: authError, + success: authSuccess + }); } $("#loginform").submit(function(event) { |