title: while clicking on button it should be redirect to another page in ajax
body: <p>i have one view requirements page in my application..in that i have one button called  working..when user click on the button i changed the status in requirements table 0 to 1 by using ajax function..</p>
  
  <p>So now the problem is when user click on the working button the button should be redirect to another page..</p>
  
  <p>i tried a lot..but i couldn't do this..</p>
  
  <p>Button:</p>
  
  <pre><code>&lt;td&gt;&lt;button id="&lt;?php echo $idata-&gt;req_id; ?&gt;" onClick="CallFunction(this.id)"  class="btn btn-info"&gt;working&lt;/button&gt;&lt;/td&gt; 
  </code></pre>
  
  <p>Ajax function:</p>
  
  <pre><code> function CallFunction(id)
  
  {
  
    var url =  'http://127.0.0.1/job_portal/index.php/Requirements/change_status/';
  
          $.ajax({
          url: url,
          type: 'POST',
          data: {req_id: id},
          dataType: 'JSON',
          success: function(data) 
          {    
              if (data === true) {
                  $('#button').text('FINISHED');
           }
  
              else
              {
                alert('error');
              }
          }
        });
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I thought success function is not working..</p>
  
  <p>Can anyone help me..how to do this..</p>
  
  <p>Thanks in advance..</p>