[wp-hackers] Problem with AJAX actions

Peter Westwood peter.westwood at ftwr.co.uk
Wed Jan 23 22:02:09 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason Maskell wrote:
| Hey guys, I'm a bit of a newbie to Wordpress, so pardon me if I've
wandered
| onto the dev list.
|
| I'm not a newbie programmer by any means, but today I've been taking a
first
| crack at extending an existing plugin and running into some ajax problems,
| probably due to my lack of understanding of how WP does it.
|
| I've registered an action:
|
| add_action('wp_ajax_nzshpcrt_createbucket','nzshpcrt_createbucket');
|
| And the nzshpcrt_createbucket function exists.. My ajax gets hit in the
| admin page and sends the request to:
|
| wp-admin/admin-ajax.php
| ?action=nzshpcrt_createbucket&name=Tester22233&cookie=[snip...]
|
| That returns a simple 0 which tells me I'm not getting the output of the
| function back, which should be JSON. So, what have I missed? How do I
check
| into why Wordpress is not doing what I think it should be doing?
|

Are you sending a GET request as that implies or a POST request?

admin-ajax.php handles POST requests.

westi
- --
Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
~ C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHl7lhVPRdzag0AcURAhE/AKC+0VissAgZgC4J2qieZg9iy/+k2QCfR1pq
l3zjT6CvGx64HzGVwXtE7wo=
=It+M
-----END PGP SIGNATURE-----


More information about the wp-hackers mailing list