setInterval、history和navigator

来源:互联网 发布:mysql怎么导入mdf文件 编辑:程序博客网 时间:2024/06/05 14:19
<!doctype html><html lang="en"><head><meta charset="UTF-8"><title>setInterval、history和navigator</title></head><body><input type="text" id="time1"><input type="text" id="time2"><button id="btn" onclick="test()">清除时间</button><button id="btn2" onclick="clock2()">累计计数</button><button onclick="clears()">清除累计</button><a href="http://www.baidu.com">跳转</a><hr><script>//prompt()function clock(){var time1 = new Date();document.getElementById('time1').value = time1;}var i = setInterval(clock,1000)function test(){clearInterval(i)}var num = 0;function clock2(){num++;document.getElementById("time2").value = num;j = setTimeout(clock2,1000)}//var j = setTimeout(clock2,3000)function clears(){clearInterval(j)}var his = window.history;//.length本页面有多少网页访问document.write(his.length)document.write(his)console.log(his.forward())//go()返回第几个页面console.log(his.go(1));document.write('<br>')var b = navigator.appName;var b_version = navigator.appVersion;document.write(b);document.write('<br>')document.write(b_version)document.write('<br>')document.write(navigator.platform)</script></body></html>

0 0
原创粉丝点击