title: jQuery AJAX call to PHP Controller
body: <p>I am calling a controller (Codeigniter) through jQuery. My dataString variable contains a simple string, which I'm trying to pass through to my controller, so I can pass it into the model. However, I'm getting an error that indicates that my $test_var is undefined. What am I doing wrong?</p>
  
  <pre><code>$('a.test').click(function (event) {
  
  
      dataString = $(this).attr('name'); 
          $.ajax({
          type:"POST",
          url:"&lt;?php echo base_url(); ?&gt;controller_name/",
          data:dataString,
          success:function (data) {
          alert('test');
          }
  
      });
      event.preventDefault();
  });
  </code></pre>
  
  <p><strong>controller</strong></p>
  
  <hr>
  
  <blockquote>
    <p>$test_var= $this->input->post('dataString');</p>
  </blockquote>