Ajax Tabs: Loading views into containers!! Possible? - 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: Ajax Tabs: Loading views into containers!! Possible? (/showthread.php?tid=2887) |
Ajax Tabs: Loading views into containers!! Possible? - El Forum - 08-29-2007 [eluser]danfloun[/eluser] Hi, I am wondering if I can use this Ajax tab script to work with my CI Project. Basically all the Ajax script does is load the pages into the tab container. Now obviously I am using model, containers and views and because of this my tab links will be written like <?php echo site_url('main/file_view'); ?> instead of simply file_view.php. The rel="ajaxcontentarea" in lthe link simply loads the content of file_view into a container. However this doesn't work and I'm wondering if it's actually possible to use this script this way! or with slight modification. Tabs: Code: <ul id="maintab" class="shadetabs"> Thanks Danny Ajax Tabs: Loading views into containers!! Possible? - El Forum - 08-30-2007 [eluser]obiron2[/eluser] the short answer is yes. The Ajax callback function needs to post the responseText into the innerHTML poperty of the container (you may want to sanitise it first). If you are calling the Ajax functions on the onLoad event you need to be aware of the Asyncrynous part of Ajax. If you make an Ajax call, your script will not wait for the response before moving on to the next line of the script. If you only use one ajax object you could overwrite the object properties and reset the update method before it has received and processed the response. search the web for 'ultimate ajax object' to find a method of creating a specific ajax object for each ajax call. Some browsers apparently limit you to two ajax calls at a time. obiron |