How can I Implement a Load More Button with Ajax?

Post Reply
ilteris
Jr. Bludit
Posts: 5
Joined: Fri Jan 01, 2021 4:56 pm

greetings to friends, thank you for this wonderful script. I am considering to be a patreon soon!

the question I want to ask is, has anyone ever made a load more-style plugin using ajax before?

I learned a little bit to do this in a SQL-based php structure, but I couldn't do it with a script like bludit.

So the question I want to ask is to create the pagination part in the form of load more and in the form of an infinite loop.

so as an example,

Code: Select all

<script>
$(document).ready(function(){
  $("button").click(function(){
    WHAT SHOULD I INSERT HERE?
  });
});
</script>
Thank you in advance,
ilteris
Jr. Bludit
Posts: 5
Joined: Fri Jan 01, 2021 4:56 pm

hi,

I solved the problem by using a javascript called 'clever infinity scroll'.

I simply introduced the article divs and gave the URL that belongs to bludit paginator as the next page url.

paginator::nextpageurl()

it's working fine now, I can share the codes with someone who needs it.

regards,
User avatar
abdulhalim
Master Bludit
Posts: 128
Joined: Thu Mar 10, 2016 6:25 pm
Location: Bandar Abbas
Been thanked: 4 times
Contact:

Hey,
Sounds delicious :D
Please share your code here to use by members if it's OK by you.
Thank you
ilteris
Jr. Bludit
Posts: 5
Joined: Fri Jan 01, 2021 4:56 pm

hey,

i am not sure if it will be avaliable to share a link with you about the javascript.

But you can find it by simply searching 'jQuery Infinite Scroll Plugin - Clever Infinite Scroll'

it has a MIT license and completely free.

I guess there are various scripts that you can implement for Bludit, but since Bludit's paginator works as ?page= this plugin can work for it.

Regards :)
chrlyclsjs
Jr. Bludit
Posts: 7
Joined: Fri Nov 19, 2021 10:11 am

Hi,

I would like to implement this on my main page which now contains al lot of articles and is very slow to load on the webbrowser.

Would it be possible to detail a little bit more how you realized that ? A piece of code would be very nice :)

Thanks very much
:)
Post Reply