Trying to get jscroll response in callback function, looking for url received in response, so that it can be updated on scrolling and get page view.
<script type="text/javascript">
$('.next-btncall').jscroll({
debug: false,
autoTrigger: true,
autoTriggerUntil: false,
loadingHtml: '<img src="/static/images/loading.svg" alt="Loading" /> Loading...',
loadingFunction: false,
padding: 20,
nextSelector: 'a.jscroll-next:last',
contentSelector: '.endless-col',
pagingSelector: '',
callback: urlUpdate(data)
});
function urlUpdate(contentSelector) {
console.log('responose of ajax');
window.history.pushState(null, null, url);
}
尝试这个
$('.next-btncall').jscroll({ contentSelector: '.endless-col', callback: function(data) { window.history.pushState(null, null, data.replace(' .endless-col', '')); } });
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.