Site icon Hip-Hop Website Design and Development

Get posts by class by way of ajax

In my page-members.php I output my checklist of classes

<?php
    $args = array(
        'orderby' => 'slug'
    );
    $classes = get_categories($args);
    foreach ($classes as $class) {
        echo '<a href="' . get_category_link($category->term_id) . '"><div class="category-block">' . $category->identify . '</div></a>';
    }
?>

I would like for a click on on these hyperlinks to fill the proper column with the posts of that class.

I’ve a js file loaded for this web page; my capabilities.php:

if (is_page()) {
    world $submit;
    if ($post->post_name == 'members') {
        wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery.js', array(), '', true);
        wp_enqueue_script('weblog', get_template_directory_uri() . '/js/weblog.js', array('jquery'), '', true);
        wp_localize_script('weblog', 'ajaxposts', array(
            'ajaxurl' => admin_url('admin-ajax.php')
        ));
    }
}

My weblog.js hundreds appropriately solely on the members web page.

What can I put into weblog.js to load posts by class?