Page 1 of 1

load content with Ajax

Posted: Sun Jun 10, 2012 2:28 pm
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

Re: load content with Ajax

Posted: Fri Jul 13, 2012 3:28 pm
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>

Re: load content with Ajax

Posted: Sat Jul 14, 2012 1:56 pm
by applejack
Take a look at jQuery load function it is very simple and you can load specific content based upon it's id.