No, you cannot directly call php functions. That would be a very large security whole.
Instead, you should be using query string parameters to figure out what action you want to perform in the php. On Mar 5, 12:10 pm, side1021 <derek.pc....@gmail.com> wrote: > Hi, > > Is there any way to call a php function directly with $.ajax()? I did > some search and the answer I've got varies from impossible to using > workarounds such as passing query string to the 'data' and let php > direct which function to call. I know that with asp.net it's possible > but i'm not familiar with PHP. Here is the code that works for me in > asp.net. > > $.ajax({ > type: "POST", > url: "Default.asp/Book", > contentType: "application/json; charset=utf-8", > data: "{}", > dataType: "json", > success: AjaxSucceeded, > error: AjaxFailed > }); > > Thanks!