Q:

cant post value using ajax in zend framework 2

I'm using ajax to post a value as given below,
but data I post wont reach the controllers ajaxAaction 
view script (which is a tpl file)
<input type="text" id='taska'>
<button id='submitTo'>button</button>

script
 $(document).ready(
    function(){

       //controller via ajax
        $("#submitTo").click(function() {  
              var message = $('#taska').val(); 

              if (message != '') { 
                  //run ajax 
                  //alert ('not empty');
                  $.post('index/ajax', 
                            {'message' : message}, 

                            //callback function
                            function (respond) {

                                 //put respond in class show-msg

                                 $(".show-msg").html(respond);                  

                     }
                  );
              } 

        });

and the action
 public function ajaxAction() {
       //get post request (standart approach) 

       $request = $this->getRequest()->getPost();

       //referring to the index
       //gets value from ajax request 
       $message = $request['message'];

      // makes disable renderer
      $this->_helper->viewRenderer->setNoRender();

      //makes disable layout
      $this->_helper->getHelper('layout')->disableLayout();

     //return callback message to the function javascript
     echo $message;
}

  } );

$.post('index/ajax', is the part where I think the error is. 
Am I defining the controller and action in the wrong way?
I've been stuck here for a while.
please help

A:

try it with $this->basePath() in  <?php echo $this->basePath();?>index/ajax

