<!DOCTYPE HTML> <html> <head> <title>Radio Helsinki - Automation Import</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="/styles/import.css" /> <script src="/javascript/jquery/jquery.min.js"></script> <script type="text/javascript"> function authSuccess(data) { alert("username: " + data.username + "\ntoken: " + data.token ); } function authError(req, status, error) { alert(status + ": '" + error + "'") } function auth() { $.ajax("/authtoken.json", { cache: false, username: $("#username").val(), password: $("#password").val(), dataType: "json", error: authError, success: authSuccess }); } $("#loginform").submit(function(event) { auth() event.preventDefault(); }); </script> </head> <body> <h1>Radio Helsinki - Automation Import</h1> <form id="loginform"> <ul> <li> <label for="name">Benutzername:</label> <input type="text" id="username" value=""> </li> <li> <label for="pass">Kennwort:</label> <input type="password" id="password" value=""> </li> <li> <input type="submit" value="Einloggen"> </li> </ul> </form> <script type="text/javascript"> $("#loginform").submit(function(event) { auth(); event.preventDefault(); }); </script> </body> </html>