Skip to content

9r3i/router.js

Repository files navigation

router.js

website basic router

version 1.0.0

route using hash url

window.location.hash;

version 2.0.0

route using state

sample

<!DOCTYPE html><html lang="en-US" dir="ltr"><head>
  <!-- browser property -->
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
  <!-- web property -->
  <title>Test &#8213; 9r3i\router.js v2</title>
  <meta name="description" content="Test router.js" />
  <meta name="keywords" content="router.js, router, test" />
  <meta name="robots" content="nofollow,noindex" />
  <meta name="author" content="9r3i" />
  <meta name="uri" content="//github.com/9r3i" />
  <!-- router property -->
  <script type="text/javascript" src="router.min.js"></script>
  <!-- inline style property -->
  <style type="text/css" media="screen,print"></style>
</head><body>
<!-- sample property -->
<script type="text/javascript" src="sample.js"></script>
<!-- inline script property -->
<script type="text/javascript"></script>
</body></html>

closing

thats all there is to it. alhamdulillaah...