experiments

All kinds of coding experiments
Log | Files | Refs | Submodules

index.html (691B)


      1 <html>
      2 <body>
      3     <a href="#/mod">Testing</a>
      4     <a href="#/tastin">Tastin</a>
      5     <a href="#/yes/this">Yes</a>
      6     <div id="cont"></div>
      7     <script type="module" src="./mod.js"></script>
      8     <script type="text/javascript">
      9         function goto(e) {
     10             console.log(location.hash)
     11             switch (location.hash) {
     12                 case '#/mod':
     13                     document.querySelector('#cont').innerHTML = '<m-mod></m-mod>'
     14                     break;
     15                 default:
     16                     document.querySelector('#cont').innerHTML = location.hash
     17             }
     18         }
     19         window.addEventListener('hashchange', goto)
     20         goto()
     21     </script>
     22 <body>
     23 </html>