问答详情
源自:6-2 06-Redis的数据结构之哈希

myhash 与myhash2有区别吗

var options = {

dataSource: sources,

className: 'paginationjs-theme-blue',

callback: function(response, pagination){

//window.console && console.log(response, pagination);

var dataHtml = '<ul class="course-list">';

$.each(response, function(index, item){

dataHtml += '<li class="item">'+

    '<div class="media">'+

 '<div class="media-left">'+

 '<a href="#">'+

   ' <img class="media-object" src="images/avatar.jpg" alt="头像">'+

   '</a>'+

 '</div>'+

 '<div class="media-body">'+

   ' <h4 class="media-heading">夜照天星</h4>'+

   '<p>'+response[index].recordNotes+'</p>'+

  ' <p class="time clearfix"><span>'+response[index].recordTime+'</span><a href="comment.html" style="visibility:'+show+'!important"><span class="count"></span>回答</a><a href="comment.html" style="visibility:'+show+'!important"><span class="view"></span>浏览</a></p>'+

 '</div>'+

'</div>'+

    '</li>';

});

dataHtml += '</ul>';


container.prev().html(dataHtml);

},

pageSize: num

};


提问者:郭彦宏 2017-10-14 21:33

个回答

  • 郭彦宏
    2017-10-14 21:34:43

    var coun=null;

    $(function(){

    //分页

    function createDemo(name,show,num){

    var container = $('#pagination-' + name);

    var result=null;

    var sources = function(){

    $.ajax({

    url: '/secondClass/deskVedio/nodesAll',

    type: 'POST',

    dataType: 'json',

    async:false,

    success: function(data) {

        result=data.notes;

    }

    })

    return result;

    }();


    var options = {

    dataSource: sources,

    className: 'paginationjs-theme-blue',

    callback: function(response, pagination){

    //window.console && console.log(response, pagination);

    var dataHtml = '<ul class="course-list">';

    $.each(response, function(index, item){

    dataHtml += '<li class="item">'+

        '<div class="media">'+

     '<div class="media-left">'+

     '<a href="#">'+

       ' <img class="media-object" src="images/avatar.jpg" alt="头像">'+

       '</a>'+

     '</div>'+

     '<div class="media-body">'+

       ' <h4 class="media-heading">夜照天星</h4>'+

       '<p>'+response[index].recordNotes+'</p>'+

      ' <p class="time clearfix"><span>'+response[index].recordTime+'</span><a href="comment.html" style="visibility:'+show+'!important"><span class="count"></span>回答</a><a href="comment.html" style="visibility:'+show+'!important"><span class="view"></span>浏览</a></p>'+

     '</div>'+

    '</div>'+

        '</li>';

    });

    dataHtml += '</ul>';


    container.prev().html(dataHtml);

    },

    pageSize: num

    };


    //$.pagination(container, options);


    container.addHook('beforeInit', function(){

    // window.console && console.log('beforeInit...');

    });

    container.pagination(options);


    container.addHook('beforePageOnClick', function(){

    // window.console && console.log('beforePageOnClick...');

    //return false

    });


    return container;

    }


    createDemo('pages','hidden',5);

    createDemo('page','visible',5);


    });