$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
Here is a typical example using jquery ajax to send variables to a php page for processing, where upon completion you get the returned html or json etc…
I used something in wordpress that allows for the ajax to be sent to a callback function for all the processing instead of a whole php page.
Basically I want to have all my callback functions in ajax.php and so it’s more organized.
Thanks
Yes, simply submit an argument like the following to your PHP file:
At the top of the PHP file, do this: