WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The code below works beautifully outside of WordPress but as soon as I attempt to execute it inside of WordPress nothing happens:

var js = jQuery.noConflict();
    js('#ClientID').live('change', function() {
            url     : 'includes/form.php',
            type    : 'POST',
            dataType: 'json',
            data    : js('#myform').serialize(),
            success: function( data ) {
                   for(var id in data) {        
                        js(id).val( data[id] );                    

I have triple checked everything, I've put an alert just above js.ajax and it executes, however if it's inside of the js.ajax({ it doesnt do anything. I'm at a loss at why this isn't working.

share|improve this question
Have you considered using Admin Ajax instead? – Rutwick Gangurde Mar 26 '12 at 4:27
Have you debugged this in a browser console? I'm wondering if any data is being POSTed by jQuery ... – EAMann Mar 26 '12 at 15:58
You are probably posting to the wrong URL. Check your console, you will probably get 404 response from the server. I suggest you rewrite your functions based on the articles suggested by others. – Mateusz Hajdziony Jan 6 '13 at 17:52

First of all I would recommend you to look through AJAX in Plugins article. If it doesn't help, take in consideration these articles as well:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.