MyBB Community Forums

Full Version: AJAX Posts Updater
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
AJAX Posts Updater

Idea:
- User click Page 2, 3, 4, etc at the top of thread.
- No new page needs to be loaded (header, footer, etc, stays the same)
- Posts on page are updated to the next page worth of posts
- Optional: Loading bar/image

Example: If your forum settings are to display 10 posts per page...
- User visits thread
- User clicks Page 2
- Posts 11-20 are loaded into the posts 1-10

Thoughts?

edit:
My first guess would be something like this:
<script type="text/javascript">
function posts_load(page)
{
new Ajax.Request('showthread.php', {method: 'get', onComplete: function(request) { $('postsdiv').innerHTML = request.responseText; }});
}
posts_load(1);
</script>
...but I have no experience in AJAX at all to do something like this.
Help would be much appreciated ^__^
Seems like a good idea, I might look into this when I get some time.
Thanks Jammer, that would be excellent if you could give it a shot. I've always wanted to implement something like this on my forums, since I haven't seen it anywhere else. ^__^
This is a pretty good idea. I personally don't know anything about AJAX though.
A small bump, if it's allowed, since I really think this suggestion is worth looking into to reduce page load times and server load.

If anyone is capable of doing it, it would be greatly appreciated.
Where's the gain? The header and footer are less than 1KB. If your server has been configured well, gain will be close to 0.
I don't see how it would reduce server load neither. Unless you're talking about parsing the header and footer, but then again, that's negligible.

So the only reason would be that it may look cool.
Hm, don't like Ajax for navigation. User can't use browser's Back, Forward and Reload button becaue the url won't change when navigate. Think about it.