Get Path Param with HTML + JavaScript

644 views Asked by At

I have a simple static HTML that prints the value of the param in queryString:

<html>
    <script type="text/javascript">
        const urlParams = new URLSearchParams(window.location.search);
        document.write(urlParams.get('param'));
    </script>
    <body></body>
</html>

http://static-page.com?param=valueParam Prints: "valueParam"

Question: There is a way to do the same with static html and path param?

Like: http://static-page.com/valueParam

0

There are 0 answers