Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title></title>
- <script src="https://code.jquery.com/jquery-3.0.0.min.js" type="text/javascript" ></script>
- </head>
- <body>
- <h2>AJAX</h2>
- Nama<br />
- <input type="text" id="name" name="name" /><br />
- Password<br />
- <input type="password" id="password" name="password" /><br />
- <button type="button" id="loadings">Request data</button>
- <p id="demo"></p>
- <script>
- $(document).ready(function(){
- $("#loadings").on("click",function(){
- $.ajax({
- url:"http://103.28.119.20:8080/SecurityApi/system/login",
- type:"POST",
- data:btoa($("#name").val() + ":" + $("#password").val() ),
- contentType:"application/json; charset=utf-8",
- dataType:"json",
- success: function(msg){ alert(msg) }
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement