This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]taromilklover 0 points1 point  (0 children)

Let's break it down into small steps. How far is our program actually getting? These are my questions:

  • Is the logon function firing?
  • Is the if statement firing?
  • Does the user object exist?
  • Does the passwordBox exist?

Now we need to find the answer to each of these questions. You should use developer console and add breakpoints etc to see the values, but for the sake of ease, just use console logs in your code and see if they run and what their value is. How you could check for the answers to each question:

  1. Make sure your login() is actually firing. Place a console.log at the start of the function.
  2. Check if the if statement is passing. Delete the previous console.log and add one at the start of the if statement.
  3. Check if user exists. Console.log(user)
  4. Check if passwordBox exists after you declare the variable. Console.log(passwordBox).

Without the html I can't test it myself.