Does Code Igniter has build in Ajax Support

I am new to Code Igniter? want to know that whether CI has built in support for Ajax or we have to use some third party library....

[eluser]Pascal Kriete[/eluser]
As of right now the framework is purely php - no javascript, so you will still need to write that yourself. However, an official jQuery library has been announced and should be out in the next few months.

Welcome to CodeIgniter.

The jQuery library is actually a wrapper library where you can add any javascript library you want to use in php.

I prefer do keep my javascript coding separate from the php programming as much as possible because most of the time it's not ajax related.

Thanks for reply..

[eluser]WoOzY KinG[/eluser]
@xwero: does jQuery's core come with some juicy features as well? That's what I always thought.

The most appealing feature for me is making javascript more easy to work with and understand. But of course there is the dom parser/engine that is the heart of jQuery and the fact that you can extend it to you liking with plugins, you can write yourself if you want.

[eluser]WoOzY KinG[/eluser]
@xwero: Actually we have the same reason of using it. Sorry that I've always included the plugin that their team developed as well. So what I mentioned was like jQuery + their plugins.

I rolled my own AJAX helper, using Prototype rather than jQuery (both are quite good, I just have more experience with the former). Here it is, in case you find it helpful:

# AJAXANCHOR: Creates link which hits URL and replaces the contents of provided CSS id
# Usage: echo ajaxAnchor('css_id_to_update', 'http://url/here', 'Name of Link');
    function ajaxAnchor($div, $url, $label, $more = '')
    {    return '<a href="#" onclick="new Ajax.Updater(\''.$div.
            '\', \''.$url.'\'); return false;" '.$more.'&gt;'.$label.'</a>';

# TOGGLELINK: Creates link that shows/hides provided CSS id
# Usage: echo toggleLink('css_id_to_toggle', 'Name of Link');
    function toggleLink($div, $label, $more = '')
    {   return '&lt;a href="#" onclick="$(\''.
        $div.'\').toggleClassName(\'hidden\'); return false;" '.

# AJAXFORM: Create simple form that posts with AJAX
# Usage: echo ajaxForm('css_id_to_update', 'http://url/to/post/to');
    function ajaxForm($div, $url, $more = '')
    {    return '&lt;form action="'.$url.'" onsubmit="new Ajax.Updater(\''.
         $div.'\', this.action, {parameters:this.serialize(),evalScripts:true});'.
         'return false;" method="POST" '.$more.'&gt;';

# AJAXLOAD: Immediately fires AJAX call, replacing content of CSS id
# Usage: echo ajaxLoad('css_id_to_load_in', 'http://url/here');
    function ajaxLoad($div, $url)
    {    return 'new Ajax.Updater(\''.$div.'\', \''.$url.'\');';

EDIT: ajaxLoad string should be wrapped in script tags, the forum is eating them. Tongue

Looking forward to CI/EE 2.0's abstracted JS libraries! Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.