簡體   English   中英

如何在回調函數中獲取Jscroll插件ajax響應

[英]How to get Jscroll plugin ajax response in callback function

嘗試在回調函數中獲取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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM