Breaking News
Loading...
,

Jquery Timeago with PHP

Share on Google Plus

Jquery Timeago with PHP




Code
Contains javascipt code. $(this).timeago()- here this element is refers to timeago class selector of the anchor tag.
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.livequery.js"></script>
<script type="text/javascript" src="js/jquery.timeago.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".timeago").livequery(function() // LiveQuery 
{
$(this).timeago(); // Calling Timeago Funtion 
});
});
</script>

//HTML & PHP Code
<?php
$time=time(); // Current timestamp eg: 1371612613
$mtime=date("c", $time); // Converts to date formate 2013-06-19T03:30:13+00:00 
?>

You opened this page <a href='#' class='timeago' title="<?php echo $mtime; ?>"></a>

You Might Also Like

0 comments

About me


Like us on Facebook