visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

page('/about', about); #582

Closed sqllyw closed 3 years ago

sqllyw commented 3 years ago

Hi,

Totally new to pages.js, trying to make a simple page work, sample is here

click 'about', but got 404, any idea? thanks


    <p></p>

    <a href="">Home</a>
    <a href="">Contact Me</a>
    <a href="./about">About</a>

    <script>
        page.base('');

        page('/about', about);

        function about() {
            document.querySelector('p')
                .textContent = 'viewing about';
        }

    </script>
sqllyw commented 3 years ago

duplicate of 581