0

I have a bunch of jQuery Ajax calls on my WordPress website. After making the update to WP 3.0, I've noticed they aren't working properly anymore.

The PHP server script is getting called, because the action takes place (Ex: deleting a record in a database, which happens successfully). The issue is that the success callback isn't firing. The error callback is firing, and returning "[object XMLHttpRequest]" when I alert the response.

Is there something that has changed with WordPress 3.0? I use the wp_deregister_script and wp_register_script WordPress functions to load the version of jQuery I desire (1.4.2). So, it should still be loading the same jQuery it always has, and ignore the jQuery that comes with WP.

The site is a membership site, so it is hard to show examples, but you can find a page open to the public here... http://www.learnwake.com/requests. Also, the main javascript file that's adding the Ajax functionality for that page can be found here: http://www.learnwake.com/wp-content/themes/learnwake/scripts/requests.js.

Mike McLin
  • 3,627
  • 7
  • 41
  • 49
  • Have you checked the error in the firebug. I have not much idea about WP, but I think you can start from there looking at firebug console – Teja Kantamneni Jun 25 '10 at 20:55
  • It is returning "404 Not found". But, the server script HAS to be running, because the database queries in the PHP are firing. I know this because I can see the records getting added/deleted, etc. – Mike McLin Jun 26 '10 at 16:01
  • What headers is the script sending? Could you post some code at the start of `requests_proc.php`? – TheDeadMedic Jun 28 '10 at 09:21
  • The script isn't sending any headers. I post a different 'action' attribute to catch and execute the code I desire on my server script. An example of what my server scripts code would be stuff like this...
    
    
    I never actually echo doctypes or any other header info on my server script...
    – Mike McLin Jun 28 '10 at 17:14
  • Sorry, apparently "
    " tags don't work in comments, or I am misusing them...
    – Mike McLin Jun 28 '10 at 17:16

1 Answers1

0

Finally got this resolved!

I was including wp-blog-header.php in my PHP AJAX script. I'm not sure if WP 3.0 changed the way they handle 404's or what, but when I changed the include to wp-load.php, everything worked, and the WordPress environment that I was using in the script, $wpdb object and some constants, were still imported and usable.

A better description, and the original answer can be found here: Original StackOverflow Answer

Community
  • 1
  • 1
Mike McLin
  • 3,627
  • 7
  • 41
  • 49