Welcome Guest, Not a member yet? Register   Sign In
AJAX for CodeIgniter sample code
#3

[eluser]Phil Sturgeon[/eluser]
Its pretty damn basic if you already know AJAX. Instead of something like:

Code:
$.getJSON("ajax.php",{country: $(this).val(), ajax: 'true'}

You would do something like:

Code:
$.getJSON("<?=site_url('controller/ajax_method');?>",{country: $(this).val(), ajax: 'true'}

Instead of echo'ing the return use:

Code:
$this->output->set_output($content);

Of course the JavaScript depends on the lib you are using but if you are trying AJAX in CI I have to assume knowledge of JS on your part.

While this method is technically AJAJ.... its all the same junk really :p


Messages In This Thread
AJAX for CodeIgniter sample code - by El Forum - 11-05-2007, 03:59 AM
AJAX for CodeIgniter sample code - by El Forum - 11-05-2007, 04:20 AM
AJAX for CodeIgniter sample code - by El Forum - 11-05-2007, 04:35 AM
AJAX for CodeIgniter sample code - by El Forum - 11-05-2007, 04:46 AM
AJAX for CodeIgniter sample code - by El Forum - 11-05-2007, 05:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB