I’ve created the following which works reasonably.
AJAX:
[code]
<script type=”text/javascript”>
$(document).ready(function() {
function update() {
$.ajax({
type: ‘POST’,
url: ‘test22.php’,
timeout: 1000,
success: function(data) {
$(“#time”).html(data);
window.setTimeout(update, 1000);
},
});
}
update();
});
</script>
PHP/ HTML:
[code]
<div id=”time”>
<?php
$timenow = date(‘H:i:s’);
echo $timemsg;
?>
</div>
All is well in terms of XHR but the downside is the page takes a performance hit – buffer rapidly fill floating around the 65% to 72% as far as I recorded which was roughly 22.78 seconds
I wanted to use this to inform/ notify customers to complete their orders exactly 7 mins 0 seconds before 23:00pm and then on the dot 23:00:00 drop (slideDown) a dialog style modal using JQuery informing customers the store is not taking any further orders for the day -> ok -> enables them to just browser but not add anything to the cart
One way I thought was get the server time once and then run it on the client side but I not to sure as to how to even implement this..
Is there any solution, ideas, approach that someone could possibly throw my way?