How to call an ajax url in wordpress. Through a javascript file
I was using http://example.com/site/wp-content/plugins/pluginname/upload.php..
This is working but now I have changed the structure.
Now I want to make a call to a function inside a class
e.g
class A{
function xyz(){
include('upload.php');
}
}
Now, I am not calling upload.php through the javascript file but loading it inside the xyz function in the class.
So I want a way to call the xyz function from the javascript file.
Thanks
Read this link http://codex.wordpress.org/AJAX_in_Plugins. Do you need to register wordpress hook wp_ajax.
Add to your php code:
In javascript
Did you see this questions:
And i think Getting Started with AJAX & WordPress Pagination helps you too.