javascript 璺敱璺宠浆
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 璺敱璺宠浆相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/OLE' title='OLE'>OLE UNC nbsp ext java switch ack text 璺宠浆
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <a href="#/home" >杩欓噷</a> <a href="#/lon">鐧藉ぉ</a> <div id="app"></div> <script type="text/javascript"> // console.log(location) //璺敱鐨勮烦杞?/span> //onhashchange鏄痺indow鐨勪竴涓柟娉?/span> window.onhashchange=function () console.log(111); console.log(location.hash); //杩欓噷鍙互鑾峰彇褰撳墠鐨勮矾鐢变俊鎭?/span> switch(location.hash) case 鈥?/span>#/home鈥?/span>: document.getElementById(鈥?/span>app鈥?/span>).innerHTML=鈥?/span><h2>璇剧▼</h2>鈥?/span>; break; case 鈥?/span>#/lon鈥?/span>: document.getElementById(鈥?/span>app鈥?/span>).innerHTML = 鈥?/span><h2>浠烽挶</h2>鈥?/span>; break; </script> </body> </html>
以上是关于javascript 璺敱璺宠浆的主要内容,如果未能解决你的问题,请参考以下文章