pklauzinski / jscroll

An infinite scrolling plugin for jQuery.

Home Page:http://jscroll.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support sending URL params.

Leodau opened this issue Β· comments

This is an enhancement request,

JSCROLL should absolutely support url query options, let's say you need to send filters to your backend to get different result.

'?customParams=data'
πŸ™ƒπŸ™ƒ

commented

Any update on this

You can do this with the callback function and window history.

var url = new URL(window.location.href);
var page = url.searchParams.get("page");
if (page == null) {
   page = 1;
}
page = parseInt(page) + 1;
url.searchParams.set("page", page);
var newUrl = url.href;
history.pushState(null, null, newUrl);```