[英]How to get Jscroll plugin ajax response in callback function
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.
尝试在回调函数中获取jscroll响应,查找响应中收到的url,以便可以在滚动时更新它并获取页面视图。
<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', '')); } });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.