0

I would like to create the "load more" button similar to facebook

http://www.ifadey.com/demos/14_load_more/

Currently , my approach is like this:

in cilent side:

$(".load").on("click", function(){
    $.post(action_url, {postID : post_id}, function() {
      $("chat").append("<div>....</div>");
    });
});

in php side

$post_id = $this->input->post("postID");
$return_list = $this->List_model->get_list($post_id);
echo json_encode($return_list);

This work fines and a traditional way, there is a problem , the code is messy as put all html tag inside jquery function, so I would like to know are there any more latest way to do ? e.g. angular / react.

But after reading some angular doc, I would perfer not to mix up angular and jquery.

Or actually has a plugin for this purpose already?

Thanks a lot for helping

user782104
  • 13,233
  • 55
  • 172
  • 312

0 Answers0