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

Doesnt work if link includes Get request (?srch=value) #720

Closed
picarica opened this issue Dec 3, 2021 · 2 comments
Closed

Doesnt work if link includes Get request (?srch=value) #720

picarica opened this issue Dec 3, 2021 · 2 comments
Labels

Comments

@picarica
Copy link

picarica commented Dec 3, 2021

Bug report

so i have site i am using pagination and if get request is present it will include that get request in pagination links too, so that it transfers over to new page

Code and configuration snippets that reproduces the problem

<a href="/page2/?srch=test">Next</a>
so i dont think there is need to put in codesandbox this is the next href link when get request is present,
my php code is as this
'linkMarkup' => "<a href='{url}?srch={$input->get->text('srch')}'><span>{out}</span></a>"];
nothing too complicated but ajax scroll doesnt seem to work with it, by itself it works flawlessly i just click the link and i am on next page with new request
also this is my initiation code

let ias = new InfiniteAjaxScroll('#grid-game', {
    item: '.GameTile.card.game',
    next: '.MarkupPagerNavNext > a',
    pagination: '.MarkupPagerNav',
    spinner: '#spinner',
});

also this is the error log in console

Start loading https://test1.mysecreturl.org/page2/?srch=test     infinite-ajax-scroll.min.js:11:8863
XHRGEThttps://test1.mysecreturl.org/page2/?srch=test&1638530810077 //note from me, idk why it adds these random numbers to the end they are in the pagination
[HTTP/1.1 500 Internal Server Error 119ms]

Uncaught (in promise) 
XMLHttpRequest { onreadystatechange: onreadystatechange(), readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, responseURL: "https://test1.mysecreturl.org/page2/?srch=test&1638530810077", status: 500, statusText: "Internal Server Error", responseType: "document", response: HTMLDocument }

Expected behavior

carry over the get request as it works without infinite ajax scroll

Environment

i am using processwire CMS on LAMP stack on centos 7 system located in europe

  • Infinite Ajax Scroll version: 3.0.0-beta.6
    i am uncluding version from cdn
    here :<script src="https://unpkg.com/@webcreate/infinite-ajax-scroll@^3.0.0-beta.6/dist/infinite-ajax-scroll.min.js"></script>
  • Browser + version: firefox 94.0 but it doesnt work anywhere
  • Operating System: Linux mint 21
@picarica picarica added the bug label Dec 3, 2021
@fieg
Copy link
Member

fieg commented Dec 3, 2021

Hi @picarica, thank you for your report.

The number 1638530810077 is an cache-busting mechanism that IAS uses, but I have the feeling that it is causing the issue here. I'm thinking about removing this way of cache-busting, but could you try one thing to make sure it is really causing the issue?

let ias = new InfiniteAjaxScroll('#grid-game', {
    item: '.GameTile.card.game',
    next: '.MarkupPagerNavNext > a',
    pagination: '.MarkupPagerNav',
    spinner: '#spinner',
});
ias.on('load', function(event) {
  event.nocache = true;
});

@picarica
Copy link
Author

picarica commented Dec 3, 2021

Hi @picarica, thank you for your report.

The number 1638530810077 is an cache-busting mechanism that IAS uses, but I have the feeling that it is causing the issue here. I'm thinking about removing this way of cache-busting, but could you try one thing to make sure it is really causing the issue?

let ias = new InfiniteAjaxScroll('#grid-game', {
    item: '.GameTile.card.game',
    next: '.MarkupPagerNavNext > a',
    pagination: '.MarkupPagerNav',
    spinner: '#spinner',
});
ias.on('load', function(event) {
  event.nocache = true;
});

this solved it thanks !

@picarica picarica closed this as completed Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants