Advertisement
Guest User

Untitled

a guest
Feb 29th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function login() {
  2.     var input_username = document.getElementById('loginUsername').value
  3.     var input_password = document.getElementById('loginPassword').value
  4.  
  5.     // Test for bad input
  6.     if (input_username == null || input_username == "", input_password == null || input_password == "") {
  7.         loginError("Invalid Input");
  8.         negative("#loginBtn");
  9.     }
  10.     else {
  11.         // Attempt authentication
  12.         nAUTH(input_username, input_password, function(result) {
  13.            
  14.             if (result.status == 'success') {
  15.                 n_debug("test1");
  16.                 loginSuccess();
  17.                 nloadPage('dashboard.html');
  18.                
  19.             }
  20.             else if (result.status == 'fail') {
  21.                 n_debug("test2");
  22.                 loginError("Incorrect username/password");
  23.                 negative("#loginBtn")
  24.             }
  25.             else {
  26.                 n_debug("test3");
  27.                 loginError("API Server Offline");
  28.             }
  29.  
  30.  
  31.         })
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement