0

我有一个简单的静态 HTML,它在 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打印:“valueParam”

问题:有没有办法对静态 html 和路径参数做同样的事情?

喜欢:http ://static-page.com/valueParam

4

0 回答 0