标签:
<!doctype html><html><head><meta charset="utf-8"><title>无标题文档</title></head><body><h1 id="tt"></h1></body></html><script>function $(id){return document.getElementById(id);}var x=new XMLHttpRequest();x.onreadystatechange=function(){if(x.status==200&&x.readyState==4){//alert(x.responseText);可以直接打印出来$(‘tt‘).innerHTML = x.responseText;}}function myt(){x.open(‘GET‘,‘a.php?‘+new Date());x.send(null);}setInterval(myt,1000);</script>
<?phpecho date(‘Y-m-d H:i:s‘);
标签:
原文地址:http://www.cnblogs.com/lsr111/p/4592773.html