2 editted code example
source | link

I think, if you change your jQuery click action selector to handle event delegation the follow buttons should work after being added by ajax.

// Change this
$( '.follow-links a' ).on('click', function(e) {
// to this
$( '.some-parent-not-added-by-ajax' ).on('click', '.follow-links a', function(e) {
// thisor mightas worklast alsoresort
$( '.follow-links'document ).on('click', 'a''.follow-links a', function(e) {

I think, if you change your jQuery click action selector to handle event delegation the follow buttons should work after being added by ajax.

// Change this
$( '.follow-links a' ).on('click', function(e) {
// to this
$( '.some-parent-not-added-by-ajax' ).on('click', '.follow-links a', function(e) {
// this might work also
$( '.follow-links' ).on('click', 'a', function(e) {

I think, if you change your jQuery click action selector to handle event delegation the follow buttons should work after being added by ajax.

// Change this
$( '.follow-links a' ).on('click', function(e) {
// to this
$( '.some-parent-not-added-by-ajax' ).on('click', '.follow-links a', function(e) {
// or as last resort
$( document ).on('click', '.follow-links a', function(e) {
1
source | link

I think, if you change your jQuery click action selector to handle event delegation the follow buttons should work after being added by ajax.

// Change this
$( '.follow-links a' ).on('click', function(e) {
// to this
$( '.some-parent-not-added-by-ajax' ).on('click', '.follow-links a', function(e) {
// this might work also
$( '.follow-links' ).on('click', 'a', function(e) {