load content with Ajax

General project discussion. NOT for help questions.
Post Reply
foxi
Forum Members
Forum Members
Posts: 12
Joined: Mon Apr 18, 2011 6:55 pm

load content with Ajax

Post by foxi »

I want to load the content of various cms made simple pages, regular pages and pages from the gallery module, with ajax.

I've installed the ajax plug-in but I dont know any Javascript or jquery and don't know how to use the functions to call the content.

could anyone please give me an example of how to do this?

thanks in advance
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1800
Joined: Wed Feb 25, 2009 4:25 am

Re: load content with Ajax

Post by DIGI3 »

I did do this once, and after a lot of fiddling and research, got it to work. Once done, however, I realized two important things: You lose out on SEO (as the site really has just one page) and you can't take advantage of caching.

Mainly I was just going after the 'pretty' factor anyway, so I faked it with a fadein, as seen on http://www.matthornsby.ca:

Code: Select all

<__script__ type="text/javascript">
      $(document).ready(function () {ldelim}
        $('#inside-content').fadeIn(1000);
      {rdelim});
</__script>
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: load content with Ajax

Post by applejack »

Take a look at jQuery load function it is very simple and you can load specific content based upon it's id.
Post Reply

Return to “General Discussion”