Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AJAX Dataload API
#2
SiL3NC3 Wrote:Hi All,

I plan to use GetSimple with a js project which should load the contents without page reloads. In that case it would be important to load the content data without the layout.

Is there any AJAX solution planned. Havent got any search results for searching the forum for AJAX.
This would be a big improvement to designers!

I'm able to code some lines by myself, and I think this would not be to hard. But with some dev hints it would be a small job to get this done.

Got any tips for me?

Here a jquery example how this will be done:

Code:
$('.link').click(function() {
        var link = $(this).attr('href');
        $.get('dataload/content/'+link, function(data) {
            $('.result').html(data);
            $('#content_block').html(data);
        });
    });

Sidebars could also be loaded totally free with jquery in background.
//SiL

Assuming that your template(s) wraps the content in a <div id="content">...</div>, you can simplify your code to
Code:
$('.link').click(function() {
  var link = $(this).attr('href');
  $('#content').load(link + ' #content');
});

If all pages but the index page are loaded with Javascript, you should give all pages but index a simple template.
You might also need to adjust the currently highlighted menu item.

But overall, I don't see any reason for avoiding page loads.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
AJAX Dataload API - by SiL3NC3 - 2011-12-30, 19:32:00
AJAX Dataload API - by mvlcek - 2011-12-30, 20:56:38
AJAX Dataload API - by m1k3y - 2011-12-30, 21:42:09
AJAX Dataload API - by SiL3NC3 - 2011-12-30, 22:14:48
AJAX Dataload API - by SiL3NC3 - 2011-12-30, 22:56:31
AJAX Dataload API - by SiL3NC3 - 2011-12-31, 22:22:05
AJAX Dataload API - by 5wooley4 - 2012-03-30, 06:06:06



Users browsing this thread: 1 Guest(s)