summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html13
1 files changed, 12 insertions, 1 deletions
diff --git a/index.html b/index.html
index 8ebe537..a07f16d 100644
--- a/index.html
+++ b/index.html
@@ -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) {