myhash 与myhash2有区别吗

来源:6-2 06-Redis的数据结构之哈希

郭彦宏

2017-10-14 21:33

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

};


写回答 关注

1回答

  • 郭彦宏
    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);


    });


Redis入门

本课程为Redis和Jedis使用的入门级教程,对Redis有初步了解

107159 学习 · 154 问题

查看课程

相似问题