Created
June 10, 2011 14:15
-
-
Save feedhenry-gists/1018908 to your computer and use it in GitHub Desktop.
Current Date/Time Cache Client Version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p> Current Time : </p> | |
<div id="current_time_response"> </div> | |
<button id='current_time'> Refresh time </button> | |
<script> | |
$(document).ready(function(){ | |
$('#current_time').click(readTime); | |
}); | |
function readTime() { | |
// Read the current time from a new Date object | |
var time = new Date().toString(); | |
// Display the time in-app using jQuery | |
$('#current_time_response').html(time); | |
} | |
// Do an initial read of the current time | |
readTime(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment