Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. <link rel="stylesheet" href="FileOfLogin/css/style.css">
  2.  
  3. <div class="wrapper">
  4. <div class="container">
  5. <h1>Welcome</h1>
  6.  
  7. <form class="form">
  8. <input id="username" type="text" placeholder="Username">
  9. <input id="password" type="password" placeholder="Password">
  10. <button id="loginsubmit" type="button" id="login-button">Login</button>
  11. </form>
  12. </div>
  13.  
  14. <ul class="bg-bubbles">
  15. <li></li>
  16. <li></li>
  17. <li></li>
  18. <li></li>
  19. <li></li>
  20. <li></li>
  21. <li></li>
  22. <li></li>
  23. <li></li>
  24. <li></li>
  25. </ul>
  26. </div>
  27.  
  28.  
  29.  
  30. <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
  31. <script src="FileOfLogin/js/index.js"></script>
  32.  
  33.  
  34. <!-- jQuery 2.1.3 -->
  35. <script src="{{ asset ("/bower_components/AdminLTE/plugins/jQuery/jQuery-2.2.3.min.js") }}"></script>
  36.  
  37. <!-- Sweet Alarm -->
  38. <script src="SweetAlert/sweetalert-dev.js"></script>
  39. <link rel="stylesheet" href="SweetAlert/sweetalert.css">
  40.  
  41.  
  42. <script type="text/javascript">
  43.  
  44. $( "#loginsubmit" ).click(function() {
  45.  
  46. console.log('111');
  47. var username=$('#username').val();
  48. var password=$('#password').val();
  49.  
  50. // console.log(username);
  51. // console.log(password);
  52.  
  53. $.ajax({
  54. type: "POST",
  55. url: "http://79.132.212.50:8080/SchoolServiceWebService/login",
  56. contentType: 'application/json',
  57. data: '{ "username": "'+username+'", "password": "'+password+'" }',
  58. dataType: "json",
  59. success: function (GetResult) {
  60. // console.log(GetResult);
  61. if (GetResult.result) {
  62. console.log(GetResult);
  63. console.log("8888888888888");
  64. window.location.href = "/AddStudent";
  65. // window.location.replace('/AddStudent');
  66. } else {
  67. sweetAlert("خطا", "ورود !!!!!!", "error");
  68. }
  69.  
  70. },
  71. error: function (xhr, ajaxOptions, thrownError) {
  72. alert(xhr.status);
  73. alert(thrownError);
  74. }
  75. })//ajax
  76.  
  77. });
  78. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement