Skip to content

Instantly share code, notes, and snippets.

@gunaevart
Created January 25, 2017 11:46
Show Gist options
  • Save gunaevart/1c200219ab3a7e783e41afe2fc4bf9e1 to your computer and use it in GitHub Desktop.
Save gunaevart/1c200219ab3a7e783e41afe2fc4bf9e1 to your computer and use it in GitHub Desktop.
<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