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 璺敱璺宠浆的主要内容,如果未能解决你的问题,请参考以下文章

浜嬩欢鐨勫啋娉″拰榛樿琛屼负

STEAM鍟嗗簵棰嗗彇OLD SCHOOL RUNESCAPE

鎴戜滑绗竴娆″彂鐨凪arvin绯诲垪鑵曡〃

Vim 缂栬緫鍣ㄥ父鐢ㄥ懡浠?/a>

vue 璺敱

鏈€鐭璈amilton璺緞