Welcome Guest, Not a member yet? Register   Sign In
Looking for AJAX reload of div
#1

[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
#2

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

[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
#4

[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.




Theme © iAndrew 2016 - Forum software by © MyBB