How to use jQuery with Code Igniter

[eluser]Anes P.A[/eluser]
Hello Pal,
I am Anes , a Newbie in code Igniter(CI). I like to know how jquery can use in code igniter(CI). I like to study same , do you can give some
Code snippet that I can work in my PC . I need to study How CI can use
jquery. Pls reply me with any good code snippet that is enough to give idea(Any working Stuff)...

With Great thanks
Anes P.A


I am using jquery and you only need to place the jquery to your public folder then if your using template embed the jquery to your template ex.
script type="text/javascript" src="<?=site_url('/public/js/jquery.js')?>"
same with your other js. to us the ajax method of jquery
   type: "POST",
   url: "/model/function",
   data: "var1/John/var2/Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );

[quote author="jhayghost" date="1257428611"]Hello,

script type="text/javascript" src="<?=site_url('/public/js/jquery.js')?>"

Use base_url() instead of site_url() for addressing CI external files, see the User Guide

Other than how CI handles url segments and by default does not use GET queries, jQuery works with CI just like it works with anything else in PHP, no difference.

You can easily go to the jQuery site and learn jQuery and should be able to apply what you know to CI with little or no adjustments.

Same thing with learning CI. CI and jQuery together isn't much different than using them alone.

I found this little page of links to CI / jQuery tutorials a little while ago.


[eluser]Ben Edmunds[/eluser]
Hey Anes,

I replied to your email.

Make sure the url helper is loaded.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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