Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfiniteAjaxScroll appends random ID on my next url and persistent href from previous state? #395

Closed
ivanasetiawan opened this issue Nov 10, 2019 · 3 comments

Comments

@ivanasetiawan
Copy link

ivanasetiawan commented Nov 10, 2019

Support question
(1) I am using InfiniteAjaxScroll v3 and figured out that when I am initialising it the next URL got modified and added with a random ID. I saw it on the official example and the random ID also got added. How can I remove this?
Example: <a class="next" href="http://abc.com:8000/browse/?page=2&page=3&page=4&page=5">Dummy next pagination</a>

But on the network tab I see http://abc.com:8000/browse/?page=2&1573396662371&page=3&1573396663965&page=4&1573396807373&page=5
I have no idea why 1573396662371, 1573396662371, and 1573396807373 got added and how to clean those IDs?

(2) On my page, there's a select element and the idea is to reinitialise InfiniteAjaxScroll when there's a change on the select, however even after I unbind and reinitialize, the Start loading URL seems to load the old state (memorized old data). How can I solve this?

Environment

  • Infinite Ajax Scroll version: 3
  • Browser version: FF Dev 71.0b5 (64-bit)
  • Operating System: Mac OS Catalina
@ivanasetiawan ivanasetiawan changed the title InfiniteAjaxScroll appends random ID on my next url? InfiniteAjaxScroll appends random ID on my next url and persistent href from previous state? Nov 10, 2019
@fieg
Copy link
Member

fieg commented Nov 11, 2019

A timestamp is added to the url to prevent caching. See https://github.com/webcreate/infinite-ajax-scroll/blob/master/src/infinite-ajax-scroll.js#L153

I understand that this isn't something you would always want. It's on my roadmap to change/improve this behavior.

@fabiocaccamo
Copy link

fabiocaccamo commented May 29, 2020

@fieg thank you for this great library.

I have a similar problem, my backend system generates the next page url using the current query string and replacing the page number value. After multiple scrolls my url looks like: ?p=7&1590774588692=&1590774590771=&1590774593008=&1590774595796=&1590774598283= because the timestamp results as a different key to the query-string parser.

It would be nice to have a simple option to don't append the timestamp to the requested url.

@fieg
Copy link
Member

fieg commented May 31, 2020

Hi @fabiocaccamo, Thanks for bring this to my attention. I'm aware of the issue and am tracking everything related to this in issue #457.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants