Welcome Guest, Not a member yet? Register   Sign In
Using a database model function with an ajax?
#1

[eluser]Jordz[/eluser]
Morning (Well it is here anyway :p),

For the past hour I've been experimenting with AJAX, it's not fully implemented into my CI app just yet I just load a view from my controller. My question is how would I send the ajax function to a database model in my CI app?
Code:
[removed][removed]
    [removed]

        $(document).ready(function(){
            $('#txtValue').keyup(function(){
                sendValue($(this).val());  
              
            });
          
        });
        function sendValue(str){
            $.post("http://localhost:8888/ajax.php",{ sendValue: str }, //<- Here... I've tried  tried putting my PHP AJAX
//controller in here as /test/ajax and even like $this->test_model->ajax()
            
function(data){
                $('#display').html(data.returnValue);
            }, "json");
          
        }

How would I go about putting the php that controls the ajax into my CI framework without creating other files that are going to clog things up.


Thanks

Jordan.


Messages In This Thread
Using a database model function with an ajax? - by El Forum - 04-08-2010, 04:54 AM
Using a database model function with an ajax? - by El Forum - 04-08-2010, 05:09 AM
Using a database model function with an ajax? - by El Forum - 04-08-2010, 05:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB