1 <script> 2 var span = document.getElementById("span"); 3 4 function time_get() { 5 var time = new Date(); 6 var year = time.getFullYear(); 7 var month = time.getMonth() + 1; 8 var day = time.getDay(); 9 var hour = time.getHours(); 10 var minute = time.getMinutes(); 11 var second = time.getSeconds()<10?"0"+time.getSeconds():time.getSeconds(); 12 13 var time_str = year + "-" + month + "-" + 14 day + " " + hour + ":" + 15 minute + ":" + second; 16 17 span.innerHTML = time_str; 18 } 21 window.setInterval("time_get()",500); 22 23 24 </script>
前两个题冒泡排序和去重算是背的还不错了,手写默写也没什么大问题;
第三题是个万年历,大体的思路也都懂,居然把function给忘记了,方法居然忘了;
还有后面获取值得时候应该是span.innerHTML = time_str;
windows.setInterval("time_get()",500);每500毫秒刷新一次的单词忘记拼;
var a = paresInt("101中学");最后a的值只是101,并不带汉字;
好多小的不常用知识点也有好多忘记,还需继续努力;
原文:http://www.cnblogs.com/xinchenhui/p/7643451.html