Call PHP Function using jQuery AJAX

后端 未结 3 1523
野趣味
野趣味 2020-11-30 12:19

I\'ve read all the topics about my question but cannot solve my problem. I want to get php function result using jQuery AJAX.

function.php

function g         


        
3条回答
  •  悲&欢浪女
    2020-11-30 12:52

    JQuery

    $.ajax({
          url: "script.php",
          type: "POST",
          data: "id=1",
          success: function(msg){
             alert(msg);
          }
       }
    

    PHP

    
    

    You'll get php function result in msg from $.ajax success state.

提交回复
热议问题