Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DOM issue after loading more with AJAX


Go to End


1428 Views

Avatar
namnn96

Community Member, 4 Posts

30 June 2016 at 5:06pm

Hi all,

I am working on a page that contains load more ajax. This is the html structure

<div id="pagination"...>
.... // items goes here
</div>
<div id="loadmore"...>
....// load more button
</div>

My ajax is whenever there is an ajax call, the "#pagination" empty itself, append the response data. Since the loadmore button needs to be updated link, I included it in the response data. This, however, causes a problem that the loadmore div is nested inside "pagination" after ajax. Any idea how should I overcome this?

Thanks in advance