ajax hash缓存
2024-10-19 15:31:22
hash 模拟url路由
function hashdone(){
var hash;
hash=(!window.location.hash)?"#one":window.location.hash;
window.location.hash=hash;
var hashStr = location.hash.replace("#","");
switch(hash){
case "#one":
alert(hashStr)
break;
case "#second":
alert(hashStr)
break;
case "#third":
alert(hashStr)
break;
}
}
hashdone()
window.onhashchange=function(){
hashdone()
}
最新文章
- [LeetCode] Pow(x, n) 求x的n次方
- 贪吃蛇(Java实现)
- django的分页
- POJ1584 判断多边形是否为凸多边形,并判断点到直线的距离
- .Net开源网络爬虫Abot介绍
- Bzoj3531: [Sdoi2014]旅行
- 编写高质量代码改善C#程序的157个建议[IEnumerable<;T>;和IQueryable<;T>;、LINQ避免迭代、LINQ替代迭代]
- bootstrap兼容IE
- wcf 远程终结点已终止该序列 可靠会话出错
- ♫【异步】短小强悍的JavaScript异步调用库
- linux分区和系统文件和挂载
- HTML 基础语言
- Amazing ASP.NET Core 2.0
- Hive篇--搭建Hive集群
- 离线安装redis-cluster
- bootstrap 中关于 HTML5 aria-* and role的用法
- c++ CreateProcess调用dos命令
- 利用channel在goroutins之间控制同步和传递数据
- 在Unity中使用Lua脚本
- cocos游戏网址