Welcome Guest, Not a member yet? Register   Sign In
Ajax implementation
#1

[eluser]Arun Joshi[/eluser]
Hi

I need to implement ajax in my ci test application. I read the instructions from
Code:
http://codeigniter.com/wiki/AJAX_for_CodeIgniter/
.
But I cant implement it. Can any one have a working example of ajax implementation in CI.

Thanks
Arun
#2

[eluser]Arun Joshi[/eluser]
I have created a test page ajaxtest.php in controllers. Its structure is

Code:
<?php
class Ajaxtest extends Controller {

    function index()
    {
        echo '<br />ajax test fn';
        $this->load->library('ajax');
        echo $this->ajax->link_to_remote("show", array('url' => '/view/view_ajax', 'update' => 'divblock'));
    }
}    
?&gt;


I also have another controller , which having the following structure.

Code:
&lt;?php
class ajaxcontent extends Controller {
        
        function index()
        {
            echo 'Its some ajax content to display in ajaxtest page...<br />';
        }

}
?&gt;


How can I load the ajaxcontent controller data in a div (divblock) in ajaxtext controller? Where should I declare the div to show the content? where to include the javascript filess.



Now I have tried more than two hours with this.

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB