Answer the question
In order to leave comments, you need to log in
How to pass a variable to PHP via AJAX?
Hello, I have never worked with AJAX and have not completely smoked the documentation on it. Can you please tell me how can I display "response.session.mid" through a variable in php?
<script language="javascript">
VK.init({
apiId: ******
});
function authInfo(response) {
if (!response.session) {
alert('not auth');
} else {
alert(response.session.mid)
}
}
VK.Auth.getLoginStatus(authInfo);
VK.UI.button('login_button');
</script>
Answer the question
In order to leave comments, you need to log in
Just push the variable into:
$.ajax
data:{}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question