Created
January 25, 2017 11:46
-
-
Save gunaevart/1c200219ab3a7e783e41afe2fc4bf9e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$.ajax({ | |
url: 'hello.php?action=hello', // куда посылаем запрос | |
type: "POST", | |
data: {'log':'lol','pass':'111'}, | |
success: function(data){ // что делаем в случае успеха, в data лежит ответ от сервера | |
alert(data); // выводим ответ | |
if(data == 'okey'){ | |
alert("Hello =)"); | |
}else{ | |
alert("Неправильный логин или пароль =("); | |
} | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment