How to call php class method using ajax
<p>I'm new to ajax. I'm trying to call get_mother method through ajax in my form textbox change event. I want to show results in datalist. below is the code i have used.</p>

<pre><code>class ChildApplication extends Application{
function __construct(){
    $this-&gt;login_required();
}
function get_mother(){
    $mother = $_POST['mother_name'];
    $mother = '%'.$mother.'%';
    $db=$this-&gt;get_dbo();
    $sql = "SELECT * FROM tbl_mother WHERE `mother_fname` LIKE ? ";
    $results = $db-&gt;load_result($sql,array($mother));
    return $results;
}
function get_child($mother){
 //statements 
}
}
</code></pre>

<p>My script is:</p>

<pre><code>   $(document).ready(function(){
     $("#mother_name").keyup(function(event){
        event.preventDefault();
         var mother = $("#mother_name").val();
         $.ajax({
            type: 'POST',
            url: 'applications/child/child.php',
            data: dataString,
            dataType: 'json',
            success: function(){
                alert("pass");
            },
            error: function(){
                alert("error");
            }
            });

           });
         });
</code></pre>

<p>none of alerts are displayed. please help me to solve the problem </p>