Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Not working i changed date abbr load by ajax #134

Closed
hemc4 opened this Issue Jun 21, 2013 · 7 comments

Comments

Projects
None yet
2 participants

hemc4 commented Jun 21, 2013

Working alright on my site normally, but when i load comments by ajax cal as it does't work

jQuery(document).ready(function() {
  $.ajax({
    url:"/site/comment",
    data:{},
    type:"GET",
    dataType:"html",
    success:function(response){ 
      $('#comment_area').html(response);
    } 
  });
  jQuery("abbr.timeago").timeago();
});

when i timeago in ajax success it shows error
TypeError: jQuery(...).timeago is not a function

Owner

rmm5t commented Jun 22, 2013

Hmm. Was jquery.timeago.js actually added to the relevant HTML page?

<script src="jquery.timeago.js" type="text/javascript"></script>

Also, if your dynamically loaded content contains the <abbr> tags, you'll want to call timeago() inside your success callback.

hemc4 commented Jun 22, 2013

Yes, i have added jquery.timeago.js file in HTML page and checked it is working properly in normal page load.
It shows TypeError: jQuery(...).timeago is not a function when i call jquery timeago() in success callback.

Owner

rmm5t commented Jun 22, 2013

Could you please distill this down to a jsfiddle or similar so I can see
this happen myself? I'm going to have a hard time helping to debug
otherwise.

hemc4 commented Jun 22, 2013

Thanks for your response.
Please check working fiddle http://jsfiddle.net/hemc/y3xFr/1/
and not working fiddle
http://jsfiddle.net/hemc/eJhAr/11/

hemc4 commented Jun 24, 2013

Any update on this?

Owner

rmm5t commented Jun 26, 2013

Sorry, I got swamped with work. I'll take a look as soon as I can. It's on my todo list. Meanwhile, if anyone else has time to debug this fiddle, much appreciated.

@hemc4 hemc4 closed this Jun 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment