CodeIgniter Forums
Looking for AJAX reload of div - 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: Looking for AJAX reload of div (/showthread.php?tid=15017)



Looking for AJAX reload of div - El Forum - 01-23-2009

[eluser]spmckee[/eluser]
Greetings,

I have a subnav with four links in it and a main div that holds the main content. All I am looking to do is to refresh the div content with AJAX when a subnav link is hit. I have looked and looked and nearly all the tutorials use forms and the database as examples. Is there anywhere I can look or any tips on how to accomplish this?

-- Not sure if this helps but I am using Jquery as my JS library. --

Thanks for your time!
SP


Looking for AJAX reload of div - El Forum - 01-23-2009

[eluser]bobbybaboon[/eluser]
Perhaps this plugin will make it easy to do what you're looking for:
ajaxified plugin


Looking for AJAX reload of div - El Forum - 01-23-2009

[eluser]spmckee[/eluser]
Bobbybaboon that works great! Problem is that it requires a URL for the link and when I supply something like href="/about/team/1" it freaks out.

Any ideas? Or has anyone else used ajaxified with success?

Thanks! -SP


Looking for AJAX reload of div - El Forum - 01-24-2009

[eluser]devbro[/eluser]
i did something similar to what you did. but i used jquery and jquery_pagination library. here is the basic idea:

there are 2 different calls to your server for this:
1. the original call which spits a full html code with everything in it
2. a secondary ajax call that only gives a PARTIAL html.

once the ajax call is complete simply use the innerHTML to fully replace inside of your div.