Learn free online HTML5, javascript, and jquery Tutorials by Examples

Monday 26 May 2014

Timeago Php in jQuery

---------------------------------------------
<script src="http://http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("a.timeago").livequery(function()
{
$(this).timeago();
});
});
</script>

<style>
body{
font-family: Helvetica,Arial,sans-serif;
color: #333;
}
#big{font-size:34px}
</style>

<?php
$time=time();
$mtime=date("c", $time);
?>
<div style='text-align:center'>

<h1>Jquery Timeago PHP</h1>


<br/><br/>
<span id='big'>You opened this page <a href='#' class='timeago' title="<?php echo $mtime; ?>"></a>.</span> <br/>
(This will update every minute. Please wait for it.)
</div>
---------------------------------------------

No comments:

Post a Comment