![]() |
CI workin with prototype. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CI workin with prototype. (/showthread.php?tid=12768) |
CI workin with prototype. - El Forum - 10-30-2008 [eluser]edwin87[/eluser] Hello CI, For my work i need to figure out if AJAX libraries like: Prototype or jQuery work with CodeIgnitor. I'm trying to implement Prototype to a standard form. In the header i have the following code: Code: [removed] It works realy good. But, when i submit the page, the responseText is the whole website instead he's only showing the form in the content div. How can i solve this problem? I've searched the whole forum but can't find any suggestions. Also i'm curious in what type ajax librarie's you are using, and why. Maybe can somebody help me here? I'm using also HMVC if it makes a difference. CI workin with prototype. - El Forum - 10-30-2008 [eluser]Pascal Kriete[/eluser] Quote:the responseText is the whole website instead he’s only showing the form in the content div.Can you clarify what you expect it to do? Quote:Also i’m curious in what type ajax librarie’s you are using, and why.I shop around a lot, but right now it's YUI and jQuery - depending on the project. CI workin with prototype. - El Forum - 10-30-2008 [eluser]edwin87[/eluser] The response text is written in the content div. So i have this site: Code: <hmtl> And when i'm subbmiten the page. The whole website is shown in the content div. Code: <hmtl> It looks a bit nasty, but that what is happening. I hope i clarified it enough for you. Thanks CI workin with prototype. - El Forum - 10-30-2008 [eluser]Colin Williams[/eluser] CI is going to return whatever you want it to. If the request comes from Ajax, you probably only want to return a portion of code, not a whole web page... So, just return the portion! This isn't CI's problem to solve. CI workin with prototype. - El Forum - 10-30-2008 [eluser]edwin87[/eluser] Can you give me an exameple? I'm a little confused right now. Thanks CI workin with prototype. - El Forum - 10-30-2008 [eluser]Pascal Kriete[/eluser] The response text is whatever the url on the other side spits out. So in this case it will be exactly what you get when you visit http://localhost/ajax/index.php/pages/id/3/edit/3. Run a check in your backend and only send out what you need for the request: Code: if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) CI workin with prototype. - El Forum - 10-30-2008 [eluser]edwin87[/eluser] I can't get this to work. No mather what i do. It's very strange. But really important for me to work. A client were we work for, expects a ajax functionality in our energy application. Are thee some examples with form submitting using ajax/CI? Is my build up not good enaugh to run this or? Any suggestions? CI workin with prototype. - El Forum - 10-30-2008 [eluser]Pascal Kriete[/eluser] Have you ever done any ajax/javascript stuff? It sounds like all you need is a little clarifications on the basics. <shameless plug> I've done two tutorials that might help get you started (the next parts are drafted, but I'm still unhappy about them). The first part lists to two others that might help you out as well. </shameless plug> CI workin with prototype. - El Forum - 10-31-2008 [eluser]edwin87[/eluser] I do have a little experience with ajax/javascript. But i found out what's wrong. In my main controller i defined the header file. So every time my page loaded he includes the header file. But that's where it goes wrong. Is there a workaround for this? Maybe using CI and jQuery with a template based engine? Are there libraries for it? |