Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8871779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:04:38+00:00 2026-06-14T18:04:38+00:00

I am using the jQuery timeago plugin from https://github.com/rmm5t/jquery-timeago It works fine on page

  • 0

I am using the jQuery timeago plugin from https://github.com/rmm5t/jquery-timeago

It works fine on page load, but I generate some content in a modal window using .load and it doesn’t seem to affect it.

To initialize timeago I have:

$(document).ready(function() {
    $('time.timeago').timeago();
});

This is the jQuery I use to load the content in the modal:

$(document).ready(function () {

    // on click, serialize all form elements and insert/update database
    $('.comment').click(function (e) {

        e.preventDefault();
        var $this = $(this);
        var csrf = $('input[name=csrf_gpin]').val();
        var pin_id = $this.closest('.grid-box').attr('data-id');

        $('input[name=comment_pin_id]').val(pin_id);

        $("#modal-comment").reveal();

        // load all comments associated with pin
        $("#comments").load('/comment/pin', { 'csrf_gpin' : csrf, 'pin_id' : pin_id });

    });
});

The HTML inside the loaded content is:

<time class="timeago" datetime="2012-11-19T20:35:14+01:00" title="November 19, 2012">2 days ago</time>

How can I re-initialize timeago so that it will work on this generated content?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:04:39+00:00Added an answer on June 14, 2026 at 6:04 pm

    Try to initialize timeago after the loading is completed:

    $("#comments").load('/comment/pin', 
               { 'csrf_gpin' : csrf, 'pin_id' : pin_id },
               function(){   //A callback function that is executed when the request completes
                   $(this).find('time.timeago').timeago();   
               });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using backbone and: https://github.com/pragmaticly/smart-time-ago When I load the page there is nothing
I am using timeago jQuery plugin for my blog, but there seems to be
I am using Jquery plugin http://timeago.yarp.com/ for showing time. Issue is timeago will not
I am currently using PHP/MySQL and the jQuery timeago plugin. Basically, I need to
Using Jquery AJAX to get a value from a PHP script. This line works
Using jQuery validation plugin but it has no CSV validation. I have made an
Using jQuery, how do I get the value from a textbox and then load
Using jQuery timepickr: http://archive.plugins.jquery.com/project/jquery-timepickr Having included these files: jquery-1.7.1.min.js jquery-ui-1.8.21.custom.min.js ui.timepickr.js And getting this
I have this jQuery ajax navigation tabs plugin that I created using some help
Using jQuery and given this <ul> <li> <a external=http://stackoverflow.com href=home.htm>Link 1</a> </li> <li> <a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.