CodeIgniter Forums
Ajax implementation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Ajax implementation (/showthread.php?tid=18783)



Ajax implementation - El Forum - 05-18-2009

[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


Ajax implementation - El Forum - 05-18-2009

[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