Guest User

Untitled

a guest
Oct 20th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <html>
  2.  
  3.  
  4. <head>
  5. <script type="text/javascript">
  6. var database = [
  7. {
  8. username : "omar",
  9. password : "secret"
  10. }
  11. ];
  12.  
  13. var newsFeed =[
  14. {
  15. username : "Amer",
  16. timeline :"i hate studying"
  17. },
  18. {
  19. username :"Khalid",
  20. timeline :"i'm hungry "
  21. }
  22.  
  23. ];
  24.  
  25. var userName= prompt("what is your username?");
  26. var passWord = prompt(" what is your password?");
  27.  
  28.  
  29.  
  30. function signIn(user,pass){
  31. if (user===database[0].username && pass === database[0].password){
  32. console.log (newsFeed);
  33.  
  34. }else
  35. alert ("sorry your username or password is not correct!");
  36.  
  37. }
  38.  
  39. signIn(userName , passWord);
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. </script>
  48. </head>
  49. <body>
  50.  
  51. </body>
  52. </html>
Add Comment
Please, Sign In to add comment