How to pass data parameter to ajax action function handler
When you use jQuery.post(), the data is sent as regular $_POST arguments. So this JavaScript … var data = { action: ‘load_post’, foo: ‘bar’ }; … is available in your callback function per: $action = $_POST[‘action’]; $foo = $_POST[‘foo’]; // bar And when you are using jQuery.get(), the data is in $_GET. You can also … Read more