Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login() {
- var input_username = document.getElementById('loginUsername').value
- var input_password = document.getElementById('loginPassword').value
- // Test for bad input
- if (input_username == null || input_username == "", input_password == null || input_password == "") {
- loginError("Invalid Input");
- negative("#loginBtn");
- }
- else {
- // Attempt authentication
- nAUTH(input_username, input_password, function(result) {
- if (result.status == 'success') {
- n_debug("test1");
- loginSuccess();
- nloadPage('dashboard.html');
- }
- else if (result.status == 'fail') {
- n_debug("test2");
- loginError("Incorrect username/password");
- negative("#loginBtn")
- }
- else {
- n_debug("test3");
- loginError("API Server Offline");
- }
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement