Calling PHP Function within Javascript

前端 未结 5 1781
有刺的猬
有刺的猬 2020-12-11 19:22

I want to know is it possible to call a php function within javascript, only and only when a condition is true. For example



        
5条回答
  •  失恋的感觉
    2020-12-11 19:42

    PHP always runs before the page loads. JavaScript always runs after the page loads. They never run in tandem.

    The closest solution is to use AJAX or a browser redirect to call another .php file from the server.

提交回复
热议问题