Download links:
JHeartbeat is a plugin for JQuery 1.0.1 that allows a web page to periodically poll the server. This polling can be used to keep the user's session alive or to download updated information.
To use JHeartbeat, add the following to the HEAD section of your website.
<script type="text/javascript" src="heartbeat.js"></script>
Next, initialize the JTicker plugin by adding the following code:
$(document).ready(function() {
$.jheartbeat.set({
url: "heartbeat.asp",
delay: 3000
}, function () {
// Callback Function
});
});
The options (Bolded) are recommended. You can omit either of them, but then defaults will be used. The callback function (Italics) is optional. When the JHeartbeat object is set, a hidden div with the id of HeartBeatDIV is created. The contents of the "heartbeat" page will be loaded into this div. You can use the callback function to manipulate this data if need be. A sample "heartbeat" page is included in the Zip file.