load more content on simple click event

$('.load_more').click(function(){
   var html = '

hello

'; var el = jQuery(html); jQuery("#container").append(el).masonry( 'appended', el, true ); });

load more content using ajax

jQuery.ajax({
    type: "POST",
    url: ajax_url,
    data: ajax_data,
    cache: false,
    success: function (html) {
        if (html.length > 0) {
            var el = jQuery(html);
            jQuery("#content").append(el).masonry( 'appended', el, true );
        }
    });
});
Advertisements