How to call a specific function in a PHP script via Ajax?

前端 未结 5 803
忘了有多久
忘了有多久 2021-02-06 15:53

Lets say I have a file called functions.php, and it has two separate functions inside:

One would get the time

And the other would get the date

How will I

5条回答
  •  遇见更好的自我
    2021-02-06 15:58

    What is the response your are getting. You are getting the response in XML or some other format. If your response is XML try with this option.

    $.ajax({
            url:path,           
                data:{projectId:inpprojectId},
                dataType:"xml",
                success:function(data){
                    $(data).find("CheckAmount").each(function(){
                        total = $(this).find("TotalAmount").text();
                        usdAmt = $(this).find("PettyCashAmount").text();    
                    validateBudget(total,inp);                  
                    });
                }       
        });
    

提交回复
热议问题