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() }
ajax hash缓存
时间: 2024-11-08 23:17:48