Configuring CodeIgniter for jquery |
[eluser]tim042829[/eluser]
I've googled a number of tutorials that illustrate using jquery with CodeIgniter, however, I do not see any of them illustrating how to configure CodeIgniter to use jquery. Example: On my workstation, I have a CodeIgniter tutorial branch at http://localhost/CodeIgniter and jquery is at: http://localhost/js/jq/jquery.js I presume that /system/application/config/config.php needs some sort of $config assignment to 'tell' CI what path to emit into the rendered content. So if you look at http://demos.blufusion.net/ajax-post, you will see the following path Code: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js I would expect the value of that URL to be assigned to some configuration expression key. Please advise thanks tim
[eluser]n0xie[/eluser]
Quote:I presume that /system/application/config/config.php needs some sort ofYou presume wrong. You don't need any configuration since CI runs server side and jQuery runs client side. The only thing you need to do for ajax calls is call a controller/method. In your controller you return some data, most likely in JSON. That is all.
[eluser]Unknown[/eluser]
You can use script tag as always in your file inside View folder, for example: Code: <html>
[eluser]tim042829[/eluser]
Thanks thaqien. I also found this: http://net.tutsplus.com/tutorials/php/ho...nd-jquery/ cheers tim
[eluser]tim042829[/eluser]
[quote author="n0xie" date="1281018008"] Quote:I presume that /system/application/config/config.php needs some sort ofYou presume wrong. You don't need any configuration since CI runs server side and jQuery runs client side. The only thing you need to do for ajax calls is call a controller/method. In your controller you return some data, most likely in JSON. That is all.[/quote] My presumption was that there was a tight integration between jQuery and CodeIgniter. My apologies. thanks
[eluser]pickupman[/eluser]
Quote:My presumption was that there was a tight integration between jQuery and CodeIgniter.They are both kick a** frameworks though.
[eluser]Yorick Peterse[/eluser]
[quote author="tim042829" date="1281040358"][quote author="n0xie" date="1281018008"] Quote:I presume that /system/application/config/config.php needs some sort ofYou presume wrong. You don't need any configuration since CI runs server side and jQuery runs client side. The only thing you need to do for ajax calls is call a controller/method. In your controller you return some data, most likely in JSON. That is all.[/quote] My presumption was that there was a tight integration between jQuery and CodeIgniter. My apologies. thanks[/quote] Codeigniter v2 will have intergration with jQuery so you're not entirely wrong.
[eluser]Crni[/eluser]
Quote:Codeigniter v2 will have intergration with jQuery so you're not entirely wrong. Have this option now? Some examples for using it? |
Welcome Guest, Not a member yet? Register Sign In |