title: AJAX Call in Wordpress is returning 0
body: <p>I am trying to retrieve some information from my database using ajax.  </p>
  
  <p>I created a plug in that inserts my javascript into my header of my page.  The code I am calling is as follows:</p>
  
  <pre><code>(function($){
  $('#txtFname').on('input', function(){
  var postData = $('#txtFname').val();
  if(window.XMLHttpRequest){
  xmlhttp = new XMLHttpRequest;
  }
  else{
  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange = function(){
  if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200){
  document.getElementById("frmResult").innerHTML = xmlhttp.responseText;
  }    
  };
  var data= "action=myAjaxFunction="+postData;
  xmlhttp.open("POST", "http://www.my-site.com/wp-admin/admin-ajax.php", true);
  xmlhttp.send(data);
  });
  })(jQuery);
  </code></pre>
  
  <p>In my functions.php file for my theme I am using I added the following(I just want to make sure its calling this function.  I already have working code to grab the data from the database):</p>
  
  <pre><code>add_action( 'wp_ajax_nopriv_myAjaxFunction', 'myAjaxFunction' );  
  add_action( 'wp_ajax_myAjaxFunction', 'myAjaxFunction' );    
  function myAjaxFunction(){ 
  echo "This function is being called";
  }
  </code></pre>
  
  <p>When I make a change to my txtFname input the output is 0;  </p>
  
  <p>I have looked through a lot of previous questions and not sure if I am missing something or just made a mistake in my code. Any help would be very appreciated.</p>