title: How can i run ajax on php codeigniter
body: <p>I'm trying to use javascript code on my codeIgniter project. But I didn't execute it. I tried too many ways for solve it: I called the external js code, it didn't work. I put in my view page it dind't work as well. I think the problem is simple but I can't see it. What do you think about this problem?</p>
  
  <p><strong>view.php</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;?php include("/external/css/style.css"); ?&gt;
  &lt;head&gt;
  &lt;title&gt;New Customer&lt;/title&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  function makeAjaxCall(){
      $.ajax({
          alert("I'm here"); // I cant see that
          type: "post",
          url: "http://localhost/codeigniter_2/index.php/homepage/verifyUser",
          cache: false,               
          data: $('#addCust').serialize(),
          success: function(json){                        
          try{        
              var obj = jQuery.parseJSON(json);
              alert( obj['STATUS']);
  
  
          }catch(e) {     
              alert('Exception while request..');
          }       
          },
          error: function(){                      
              alert('Error while request..');
          }
   });
  }
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Customer Add&lt;/h1&gt;&lt;a href="http://localhost/codeigniter_2/index.php"&gt;list&lt;/a&gt;
      &lt;form name="addCust" method="post" action="insert"&gt;
  &lt;table border="1"&gt;
  &lt;tr&gt;
  &lt;th&gt;Customer Name:&lt;/th&gt;
  &lt;td&gt;&lt;input type="text" id="custom" name="customerName"/&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;th&gt;Customer Phone:&lt;/th&gt;
  &lt;td&gt;&lt;input type="text" name="phone"/&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;th&gt;Address:&lt;/th&gt;
  &lt;td&gt;&lt;input type="text" name="address"/&gt;&lt;/td&gt;
  .
  .
  .
  &lt;tr&gt;
  &lt;td&gt;&lt;input type="button" onclick="javascript:makeAjaxCall();" value="Submit"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="reset"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/form&gt;
  &lt;/table&gt; 
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>conroller.php</strong></p>
  
  <pre><code>public function verifyUser()
      {
          $userName =  $_POST['customerID'];
          $phone =  $_POST['phone'];
          $address = $_POST['address'];
          if($userName=='' &amp;&amp; $phone=11){
  
              $status = array("STATUS"=&gt;"true");  
          }
          echo json_encode ($status) ;    
      }
  </code></pre>
  
  <p>What's wrong??</p>