今天美化博客園自學的哈,分享一下
python
<!--標題變成時鐘--> <div id="Header1_HeaderTitle"></div> <script> function get_time() { var obj = new Date(); var hour = obj.getHours(); var min = obj.getMinutes(); var seconds = obj.getSeconds(); if (parseInt(seconds)<10)seconds='0'+seconds; if (parseInt(hour)<10)hour='0'+hour; if (parseInt(min)<10)min='0'+min; var time = hour + '時' + min + '分' + seconds + '秒' var title = document.querySelector('#Header1_HeaderTitle') title.innerText = time } setInterval('get_time()',1000) setInterval(function () { console.log(1) },1000) </script>
1.獲取時間code
2.循環執行獲取時間ip
3.把時間寫在頁面中get