<!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>
<script> //onhashchange : 事件:当hash值有变化的时候,就会触发 window.onload = function(){
var oInput = document.getElementById('input1');
var oDiv = document.getElementById('div1'); var obj = {}; oInput.onclick = function(){ var number = randomNum(35,7); oDiv.innerHTML = number; var oRD = Math.random(); obj[oRD] = number; window.location.hash = oRD; }; window.onhashchange = function(){
var number = obj[window.location.hash.substring(1)] || ''; oDiv.innerHTML = number;
}; function randomNum(alls,now){ var arr = [];
var newArr = []; for(var i=1;i<=alls;i++){
arr.push(i);
} for(var i=0;i<now;i++){
newArr.push( arr.splice(Math.floor(Math.random()*arr.length),1) );
} return newArr; } }; </script>
</head> <body>
<input type="button" value="35选7" id="input1" />
<div id="div1"></div>
</body>
</html>

最新文章

  1. javascript变量的作用域
  2. asp值mysql驱动
  3. MAC解决端口占用
  4. EF 自定义校验设置和捕获异常
  5. NodeJs 中的Crypto 加密模块
  6. CentOS下MySQL忘记root密码解决方法【转载】
  7. Linux下安装FTP
  8. Linux下OpenCV的环境搭建(转)
  9. javascript算法(一)
  10. dummy_backend_queue.go
  11. 带着萌新看springboot源码8(spring ioc源码 完)
  12. DCM、PLL、PMCD、MMCM相关
  13. 3.3.1 MyBatis框架介绍
  14. dynamo与cassandra区别
  15. 国内常用NTP服务器地址及
  16. Dictionary在多线程情况下
  17. echarta3 北京,上海地图
  18. Import SQL into MySQL with a progress meter
  19. ZOJ 1913 J-Eucild&#39;s Game
  20. 【Ubuntu】编写一个c语言代码

热门文章

  1. 3-6局部变量的存储方式 &amp; 3-7字符型字面值
  2. E20190303-hm
  3. (水题)Codeforces - 4C - Registration system
  4. OpenCV第二课,嵌入MFC
  5. Codevs 1961 躲避大龙
  6. express框架之1
  7. python 之 函数 迭代器
  8. python 的 数据类型
  9. day01 继承
  10. error: unrecognized command line option &quot;-std=c11&quot; 解决办法