21,886
社区成员
发帖
与我相关
我的任务
分享
谢谢.....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>刷服务器时间代码</title>
</head>
<body>
<script src="/inc/javascript/jquery.js"></script>
<script>
$(function(){ // DOM文档已经载入就绪
get_time();
});
function get_time()
{
get_server_time();
}
function get_server_time()
{
$.post("/inc/demo/date.php", //这里写php 页面的地址
function(data){
$("#showTime").html("服务器时间为"+data);
}
);
setTimeout(get_server_time,1000);
}
</script>
<div id="showTime"></div>
</body>
</html>
<?php
echo date("Y-m-d H:i:s");
?>