[Solved] how to put javascript variable in php inside the javascript code


PHP code was compiled and run once when you done loading your page. But javascript function can be used many time! So, some function like this does not exist.

You can use Ajax to accomplish what you want, whenever you wanna retrieve UserID, you can call an ajax, then ajax do a request to server and return you what you need!

Have a try 🙂

0

solved how to put javascript variable in php inside the javascript code