![]() |
CI using Prototype - 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: CI using Prototype (/showthread.php?tid=12879) |
CI using Prototype - El Forum - 11-03-2008 [eluser]Rey Philip Regis[/eluser] Hey guys, I need an advice with reagrds to writing ajax using Code Igniter. I made some simple sample code using CI and Prototype and its running. What I want to know now, is if Im doing it the right way, I mean if what Ive done (the coding style) is correct. Please give me some advice on this. Steps: Step 1: Create an htaccess file and configure the config.php. Step 2: Put the put the scriptaculous folder (with scriptaculous.js and prototype.js) in the system folder. Strp 3: Code Heres the code: Code: Controller: (ajax.php) Code: View: (simple_ajax.php) Any advice to improve? By the way that's not [removed] that's innerHTML. Why does that change? Good day..... CI using Prototype - El Forum - 11-03-2008 [eluser]jcopling[/eluser] About the only thing I may suggest is to populate your AJAX URL with the CI base_url() function. Once you write about 30 AJAX calls and then want to push live, it will save you the trouble of searching for all those URL strings and replacing them. Otherwise, it looks like you're right on track. CI using Prototype - El Forum - 11-03-2008 [eluser]Nick Husher[/eluser] I'd suggest to move your scripts to an external file if you plan on doing anything too sophisticated. Build the site to work with no scripting and layer the scripts on top. CI using Prototype - El Forum - 11-03-2008 [eluser]Rey Philip Regis[/eluser] Thanks for the advice guys.... CI using Prototype - El Forum - 12-19-2009 [eluser]paulon[/eluser] this thread is not working... =( CI using Prototype - El Forum - 12-20-2009 [eluser]CI_avatar[/eluser] the easiest way to use ajax with codeigniter is simply treat ajax in normal way. dont try to integrate it with codeigniter. |