Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $("#login").click(function() {
- var username = $("#username").val();
- var password = $("#password").val();
- $.ajax({
- url: "https://myanimelist.net/api/account/verify_credentials.xml",
- type: "GET",
- dataType: "XML",
- beforeSend: function(xhr) {
- xhr.setRequestHeader("Authorization", "Basic" + btoa(username + ":" + password));
- }
- })
- .done(function() {
- $("#loginForm").css("display", "none");
- $("#msg").css("visibility", "visible");
- $("#msg").text("Successfully logged in.");
- })
- .fail(function() {
- $("#msg").css("visibility", "visible");
- $("#msg").text("Failed to log in.");
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement