Calling PHP Function within Javascript

前端 未结 5 1784
有刺的猬
有刺的猬 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:35

    The PHP function cannot be called in the way that you have illustrated above. However you can call a PHP script using AJAX, code is as shown below. Also you can find a simple example here. Let me know if you need further clarification

    Using Jquery

    
    
    

    Barebones Javascript Alternative

       
    

提交回复
热议问题