H
H
Hakhagmon2014-08-19 10:42:18
PHP
Hakhagmon, 2014-08-19 10:42:18

how to pass variable value from javascript to php?

How to get the value of a variable through callback

<script src="https://api.vk.com/.......?callback=MUSIC"></script>
<?php 
действие с полученной переменной
?>

How to get MUSIC value in php, ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Petrov, 2014-08-19
@Hakhagmon

MUSIC is the name of your function in the global context. That is, when the request is executed, a dynamically created script will appear in your document, in which the MUSIC function will be called with the passing of the arguments specified in the same script.
Question - how are you going to find out the content of a function written in a client script in PHP?

S
Sergey, 2014-08-19
Protko @Fesor

Using the normal API. There is a normal REST API, jsonp is only needed for older browsers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question