Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- $("#login_btn").click(function() {
- var username = $("#username").val();
- var password = $("#password").val();
- $("#login_btn").hide();
- $.ajax({//AJAX request
- type: "post",
- url: "https://URL.com/function_app/test.php",
- cache: false,
- async: true,
- data: {username: username, password: password},
- dataType: 'json', // You have to add this line
- success: function (data) {
- alert("works");
- $("#login_message").html(data.result);
- $("#login_btn").show();
- },
- error: function (data) {
- alert( "Request failed: " + data.result );
- $("#login_btn").show();
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement