2016年12月7日 星期三

進階 jquery polling 即使 request 失敗也不會停止

function doPoll(){
    $.post('ajax/test.html').done(function(data) {
        /* process */
    }).always(function() {
        setTimeout(doPoll, 5000);
    });
}

沒有留言: